]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Avoid a duplicate "missing middle file seq" warning.
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Feb 2021 13:55:14 +0000 (15:55 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Feb 2021 09:51:13 +0000 (09:51 +0000)
The previous changes fixed repeating warning, but it was still possible
that the warning was logged twice. Now it's logged only once.

src/lib-index/mail-index-view-sync.c

index f4befb9df811d22eba7acdc19a6aec5943355d31..ea50ca3ed92684b6a97c0d1779f5535f74cc3c8e 100644 (file)
@@ -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);