[Dovecot] 1.0alpha3: fcntl() complaints?
Hi,
Since installing 1.0alpha3 this morning, I've seen this syslog complaint a few times. Anything to worry about? A "server too busy" issue?
imap(user): fcntl() failed with mbox file /var/mail/user: Resource temporarily unavailable
Jeff Earickson Colby College
On Mon, 2005-09-26 at 12:55 -0400, Jeff A. Earickson wrote:
Hi,
Since installing 1.0alpha3 this morning, I've seen this syslog complaint a few times. Anything to worry about? A "server too busy" issue?
imap(user): fcntl() failed with mbox file /var/mail/user: Resource temporarily unavailable
Hmm.. I just recently changed that code to write error message if it happens. In 1.0-stable it's silently ignored. But I'm not really sure why it would happen. I don't think it should happen as long as I'm trying to lock using F_SETLKW (waiting the lock) instead of F_SETLK (try locking).
F_SETLK is used when unlocking the file. But why would unlocking fail? Or maybe it does with NFS lockd?
Linux's fcntl() man page doesn't talk about F_SETLK explicitly, but I'd think that's what it means:
EACCES or EAGAIN
Operation is prohibited by locks held by other processes. Or,
operation is prohibited because the file has been memory-mapped
by another process.
Solaris's man page says it only happens with F_SETLK. UNIX98 says the same.
Maybe I should just change it to be ignored again.. Would be nice to know what the cause is though.
Timo, The mbox file /var/mail/user is NFS mounted. I've noticed the fcntl() message when the imap server is busy. In fact today at 11 AM, dovecot basically had a coronary. Nobody could authenticate, and the load on my imap server went out of sight. I got a lot of syslog messages like:
dovecot-auth[5686]: [ID 275322 user.error] PAM-KRB5 (auth): Error initializing krb5: Unknown code 24
I shut down dovecot, killed off all of its processes (hard on the users), restarted, everything ok after that.
Is there any kind of load-based control, like sendmail uses, that would reject connections if "uptime" load > N?
Jeff Earickson Colby College
On Tue, 27 Sep 2005, Timo Sirainen wrote:
Date: Tue, 27 Sep 2005 22:25:44 +0300 From: Timo Sirainen tss@iki.fi To: Jeff A. Earickson jaearick@colby.edu Cc: dovecot@dovecot.org Subject: Re: [Dovecot] 1.0alpha3: fcntl() complaints?
On Mon, 2005-09-26 at 12:55 -0400, Jeff A. Earickson wrote:
Hi,
Since installing 1.0alpha3 this morning, I've seen this syslog complaint a few times. Anything to worry about? A "server too busy" issue?
imap(user): fcntl() failed with mbox file /var/mail/user: Resource temporarily unavailable
Hmm.. I just recently changed that code to write error message if it happens. In 1.0-stable it's silently ignored. But I'm not really sure why it would happen. I don't think it should happen as long as I'm trying to lock using F_SETLKW (waiting the lock) instead of F_SETLK (try locking).
F_SETLK is used when unlocking the file. But why would unlocking fail? Or maybe it does with NFS lockd?
Linux's fcntl() man page doesn't talk about F_SETLK explicitly, but I'd think that's what it means:
EACCES or EAGAIN Operation is prohibited by locks held by other processes. Or, operation is prohibited because the file has been memory-mapped by another process.
Solaris's man page says it only happens with F_SETLK. UNIX98 says the same.
Maybe I should just change it to be ignored again.. Would be nice to know what the cause is though.
On Tue, 2005-09-27 at 17:31 -0400, Jeff A. Earickson wrote:
Is there any kind of load-based control, like sendmail uses, that would reject connections if "uptime" load > N?
That could be useful, but I'm not really sure what would be a good way to implement it. Maybe if some file exists (/var/run/dovecot/no-connections or something?) and Dovecot master process notices it, it stops accepting new imap/pop3 connections? The file would then be created by some script you're running that checks the load. And I think that file should be deleted when Dovecot is started, so that people don't wonder why Dovecot isn't working.
Timo, If you don't mind "borrowing" code, take a look at the getla() routines in conf.c of the public-domain sendmail. This file uses a bunch of "peer into the kernel for load statistics" calls for various versions of unix, eg "kstat(3KSTAT)" for Solaris and pstat_dynamic() for HPUX.
getla() queries the kernel for the current load, then sleeps or refuses connections for a brief period until the load drops. Just a suggestion.
Jeff Earickson Colby College
On Fri, 28 Oct 2005, Timo Sirainen wrote:
Date: Fri, 28 Oct 2005 22:11:19 +0300 From: Timo Sirainen tss@iki.fi To: Jeff A. Earickson jaearick@colby.edu Cc: dovecot@dovecot.org Subject: Re: [Dovecot] 1.0alpha3: fcntl() complaints?
On Tue, 2005-09-27 at 17:31 -0400, Jeff A. Earickson wrote:
Is there any kind of load-based control, like sendmail uses, that would reject connections if "uptime" load > N?
That could be useful, but I'm not really sure what would be a good way to implement it. Maybe if some file exists (/var/run/dovecot/no-connections or something?) and Dovecot master process notices it, it stops accepting new imap/pop3 connections? The file would then be created by some script you're running that checks the load. And I think that file should be deleted when Dovecot is started, so that people don't wonder why Dovecot isn't working.
participants (2)
-
Jeff A. Earickson
-
Timo Sirainen