From: Timo Sirainen Date: Tue, 31 Mar 2020 15:53:33 +0000 (+0300) Subject: lib-index: Wait for lock in cache compression, not just try once X-Git-Tag: 2.3.11.2~380 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46a5db4d0233ba81d144df01a82a8bec4988aafb;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Wait for lock in cache compression, not just try once Sometimes there's an important reason for the cache to be compressed, and it shouldn't give up just because there's a race condition with another process that just happens to be writing to it. --- diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index 127059251e..b1a358cf84 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -495,9 +495,9 @@ mail_cache_compress_full(struct mail_cache *cache, the same time, but locking the cache file itself prevents other processes from doing other changes to it (header changes, adding more cached data). */ - switch (mail_cache_try_lock(cache)) { + switch (mail_cache_lock(cache)) { case -1: - /* already locked or some other error */ + /* lock timeout or some other error */ return -1; case 0: /* cache is broken or doesn't exist.