]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fs-compress, fs-crypt, fs-metawrap: Add ASYNC_NOQUEUE in fs_file_init_parent
authorMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 11 Feb 2020 09:16:54 +0000 (10:16 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 17 Feb 2020 10:33:03 +0000 (10:33 +0000)
In order to prevent hangs or waiting on empty ioloops when the number of
mails to prefetch exceeds the lib-http request-queue length, add the
FS_OPEN_FLAG_ASYNC_NOQUEUE flag when calling fs_file_init_parent.

This additional flag makes sure that the file-operations will be handled
immediately without additional command queueing.

src/lib-fs/fs-metawrap.c
src/plugins/fs-compress/fs-compress.c
src/plugins/mail-crypt/fs-crypt-common.c

index 55e227592ee38c2752c110576d5cd47e7b96b8b2..2fb8a203309fa595590967344810cb9c30151e6b 100644 (file)
@@ -119,7 +119,8 @@ fs_metawrap_file_init(struct fs_file *_file, const char *path,
                /* use async stream for parent, so fs_read_stream() won't create
                   another seekable stream needlessly */
                file->super_read = fs_file_init_parent(_file, path,
-                       mode | flags | FS_OPEN_FLAG_ASYNC);
+                       mode | flags | FS_OPEN_FLAG_ASYNC |
+                       FS_OPEN_FLAG_ASYNC_NOQUEUE);
        } else {
                file->super_read = file->file.parent;
        }
index 07862859727e5ecebf6c67b3137f54f3d0aadfcf..1f86a43d0ec3e7357c0b267b7e7c53680379e56a 100644 (file)
@@ -129,7 +129,8 @@ fs_compress_file_init(struct fs_file *_file, const char *path,
                /* use async stream for parent, so fs_read_stream() won't create
                   another seekable stream needlessly */
                file->super_read = fs_file_init_parent(_file, path,
-                       mode | flags | FS_OPEN_FLAG_ASYNC);
+                       mode | flags | FS_OPEN_FLAG_ASYNC |
+                       FS_OPEN_FLAG_ASYNC_NOQUEUE);
        } else {
                file->super_read = file->file.parent;
        }
index c46b5c4ffaa91978b9a9409788925c98b6bc34ab..6b52ec7bccba48877c6ee1ecb274519e8333acf8 100644 (file)
@@ -156,7 +156,8 @@ fs_crypt_file_init(struct fs_file *_file, const char *path,
                /* use async stream for super, so fs_read_stream() won't create
                   another seekable stream needlessly */
                file->super_read = fs_file_init_parent(_file, path,
-                       mode | flags | FS_OPEN_FLAG_ASYNC);
+                       mode | flags | FS_OPEN_FLAG_ASYNC |
+                       FS_OPEN_FLAG_ASYNC_NOQUEUE);
        } else {
                file->super_read = file->file.parent;
        }