]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage/index: If mail stream was already opened, do not count it as slow vsize...
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Nov 2021 10:31:49 +0000 (12:31 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 2 Dec 2021 08:11:06 +0000 (08:11 +0000)
imapc storage driver will open the mail stream in some circumstances during search,
so do not consider this as slow vsize.

src/lib-storage/index/index-mailbox-size.c

index 155d88df5456069cbe4ab9a18dbb977c55ac940e..0ac22bce6f1460817fa3612b5b34bce8b726de4e 100644 (file)
@@ -330,6 +330,14 @@ index_mailbox_vsize_hdr_add_missing(struct mailbox_vsize_update *update,
 
        while (mailbox_search_next(search_ctx, &mail)) {
                if (mails_left == 0) {
+                       if (mail->mail_stream_opened) {
+                               /* Seems stream is opened by mailbox search, so we
+                                  will stop here, and finish it on background. */
+                               index_mailbox_vsize_finish_bg(update,
+                                                             require_result);
+                               ret = -1;
+                               break;
+                       }
                        /* if there are any more mails whose vsize can't be
                           looked up from cache, abort and finish on
                           background. */