do1 at yandex.ru
2013-Jul-08 18:42 UTC
[Dovecot] Non-blocking file_dotlock_open() in quota-maildir question
Hello, Is it safe to change lines in plugins/quota/quota-maildir.c::maildirsize_write() from ? fd = file_dotlock_open_group(.., DOTLOCK_CREATE_FLAG_NONBLOCK, ..); to ? fd = file_dotlock_open_group(.., 0, ..); ? Rationale is: exim+cpanel frequently leave stale maldirsize.lock, but when quota plugin try to dotlock maildirsize, it do this with NONBLOCK flag and just once, so first lock fails with EAGAIN and second may never happen. (When last mail is over quota this also prevent user from further receiving any mail because quota remain exceeded, forver. This is annoing problem.) I wonder if it is possible to do easy fix problem by removing NONBLOCK flag, but as I don't understand why this NONBLOCK flag is used in the first place I decided to ask developers in the list for approval. If removing NONBLOCK flag is not possible I will just call file_dotlock_open_group() twice if first one return -1 with EAGAIN. Best regards, Don.
Timo Sirainen
2013-Jul-10 06:37 UTC
[Dovecot] Non-blocking file_dotlock_open() in quota-maildir question
On Mon, 2013-07-08 at 22:42 +0400, do1 at yandex.ru wrote:> Hello, > > Is it safe to change lines in plugins/quota/quota-maildir.c::maildirsize_write() from > fd = file_dotlock_open_group(.., DOTLOCK_CREATE_FLAG_NONBLOCK, ..); > to > fd = file_dotlock_open_group(.., 0, ..); ? > > Rationale is: exim+cpanel frequently leave stale maldirsize.lock, but when quota plugin try to dotlock maildirsize, it do this with NONBLOCK flag and just once, so first lock fails with EAGAIN and second may never happen. (When last mail is over quota this also prevent user from further receiving any mail because quota remain exceeded, forver. This is annoing problem.) I wonder if it is possible to do easy fix problem by removing NONBLOCK flag, but as I don't understand why this NONBLOCK flag is used in the first place I decided to ask developers in the list for approval.Here's a better fix: http://hg.dovecot.org/dovecot-2.2/rev/24d6708cea76
Maybe Matching Threads
- 2.2.21 imap core dump after enabling autoexpunge
- Error: file_dotlock_open() failed with file $FILE ENOENT
- dovecot 1.1.2 dbox file_dotlock_open() failed with file
- 1.2.alpha1: file_dotlock_open() failed with subscription file
- Error: file_dotlock_open() failed with file + Too many open files