From: Markus Valentin Date: Tue, 11 Feb 2020 09:16:54 +0000 (+0100) Subject: fs-compress, fs-crypt, fs-metawrap: Add ASYNC_NOQUEUE in fs_file_init_parent X-Git-Tag: 2.3.11.2~604 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18828ad18576c721ce665491578760b4eee27cec;p=thirdparty%2Fdovecot%2Fcore.git fs-compress, fs-crypt, fs-metawrap: Add ASYNC_NOQUEUE in fs_file_init_parent 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. --- diff --git a/src/lib-fs/fs-metawrap.c b/src/lib-fs/fs-metawrap.c index 55e227592e..2fb8a20330 100644 --- a/src/lib-fs/fs-metawrap.c +++ b/src/lib-fs/fs-metawrap.c @@ -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; } diff --git a/src/plugins/fs-compress/fs-compress.c b/src/plugins/fs-compress/fs-compress.c index 0786285972..1f86a43d0e 100644 --- a/src/plugins/fs-compress/fs-compress.c +++ b/src/plugins/fs-compress/fs-compress.c @@ -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; } diff --git a/src/plugins/mail-crypt/fs-crypt-common.c b/src/plugins/mail-crypt/fs-crypt-common.c index c46b5c4ffa..6b52ec7bcc 100644 --- a/src/plugins/mail-crypt/fs-crypt-common.c +++ b/src/plugins/mail-crypt/fs-crypt-common.c @@ -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; }