From: Timo Sirainen Date: Wed, 3 Feb 2021 13:55:14 +0000 (+0200) Subject: lib-index: Avoid a duplicate "missing middle file seq" warning. X-Git-Tag: 2.3.15~413 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9accb79b489675ef18f7db63e24a75fa6c1ad3eb;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Avoid a duplicate "missing middle file seq" warning. The previous changes fixed repeating warning, but it was still possible that the warning was logged twice. Now it's logged only once. --- diff --git a/src/lib-index/mail-index-view-sync.c b/src/lib-index/mail-index-view-sync.c index f4befb9df8..ea50ca3ed9 100644 --- a/src/lib-index/mail-index-view-sync.c +++ b/src/lib-index/mail-index-view-sync.c @@ -591,8 +591,15 @@ mail_index_view_sync_begin(struct mail_index_view *view, } if (ret == 0) { - e_warning(view->index->event, - "%s - generating missing logs", error); + /* Log the warning only when all expunges have been synced + by previous syncs. This way when there's a _FLAG_NOEXPUNGES + sync, there's no second warning logged when the expunges + finally are synced. */ + if (view->log_file_expunge_seq == view->log_file_head_seq && + view->log_file_expunge_offset == view->log_file_head_offset) { + e_warning(view->index->event, + "%s - generating missing logs", error); + } ctx->log_was_lost = TRUE; if (!sync_expunges) i_array_init(&ctx->expunges, 64);