changeset 19786:deed74084f66

lib-index: mail_index_sync_next() didn't always return expunges sorted Maildir and mbox formats were using index_sync_changes_read(), which assumed that they were sorted. So some of the intended expunges weren't actually always being done. This mainly affected when expunges were being done simultaneously by multiple processes or by pipelined commands. For example: printf "a select inbox\nb uid move 2 Trash\nc uid move 1 Trash\nd logout\n" | ./imap
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 21 Feb 2016 03:40:48 +0200
parents 6022b536bf25
children 984353e3b41b
files src/lib-index/mail-index-sync.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync.c	Tue Feb 16 18:05:59 2016 +0100
+++ b/src/lib-index/mail-index-sync.c	Sun Feb 21 03:40:48 2016 +0200
@@ -206,6 +206,7 @@
 	i_array_init(&ctx->sync_list, keyword_count + 2);
 
 	if (array_is_created(&sync_trans->expunges)) {
+		mail_index_transaction_sort_expunges(sync_trans);
 		synclist = array_append_space(&ctx->sync_list);
 		synclist->array = (void *)&sync_trans->expunges;
 	}