[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.
On Mon, 2013-07-08 at 22:42 +0400, do1@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
participants (2)
-
do1@yandex.ru
-
Timo Sirainen