Bug or feature: (Too) Many imapd processes hanging around?

Matthew Schumacher matt.s at aptalaska.net
Mon Oct 8 16:48:22 EDT 2012


On 10/04/2012 04:41 AM, Andreas Haumer wrote:
>> I checked about 20 processes and all of them hang on the F_SETLKW fcntl() call on fileid #16 which always points to the same file (/cluster/var/imap/user/o/office.seen)
> 
> Using lsof I could identify the process which was holding the
> lock on /cluster/var/imap/user/o/office.seen:
> 
> ravel:/var/log # lsof /cluster/var/imap/user/o/office.seen | grep 16uW
> imapd   27522 cyrus   16uW  REG  147,0    57804 3686853 /cluster/var/imap/user/o/office.seen
> 
> This process itself was waiting in a futex() call!
> 
> A SIGHUP did not help, but a SIGTERM made the process terminate:
> 
> ravel:~ # strace -p 27522
> Process 27522 attached
> futex(0x7f5c8b149620, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
> --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=20435, si_uid=0} ---
> rt_sigreturn()                          = 202
> futex(0x7f5c8b149620, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
> --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=20435, si_uid=0} ---
> +++ killed by SIGTERM +++
> 
> I would rather not upgrade to 2.4 bypassing the official OpenSUSE
> packages (well, if absolutely necessary, I could, but I would like
> to avoid this path)

I have exactly the same issue:

I found on my system that this file:

/cyrus/mailboxes/e/user/escalations/cyrus.index

Was being held open by 6423 children processes which all reported:

fcntl(17, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}

The process that was holding the lock reported:

futex(0x7f6d86e0f720, FUTEX_WAIT_PRIVATE, 2, NULL

After I killed it, everything else seems to be closing out, but slowly.

As a data point I'm running a fairly different config as Andreas:

Ext4 file system on native partition (though it's a vmware disk) so no drdb

Cyrus 2.4.16 with the following patches:

cyrus-imapd-2.4.4-autocreate-0.10-0.patch
cyrus-imapd-2.4.12-autosieve-0.6.0.patch

lessLogs.patch:

diff -ruN cyrus-imapd-2.4.16.orig/imap/userdeny_db.c
cyrus-imapd-2.4.16/imap/userdeny_db.c
--- cyrus-imapd-2.4.16.orig/imap/userdeny_db.c	2012-04-19
01:39:51.000000000 -0800
+++ cyrus-imapd-2.4.16/imap/userdeny_db.c	2012-08-24 17:01:40.276482897
-0800
@@ -81,7 +81,6 @@
     if (!deny_dbopen) return 0;

     /* fetch entry for user */
-    syslog(LOG_DEBUG, "fetching user_deny.db entry for '%s'", user);
     do {
 	r = DENYDB->fetch(denydb, user, strlen(user), &data, &datalen, NULL);
     } while (r == CYRUSDB_AGAIN);


Here is my database config:
duplicate_db: skiplist
tlscache_db: skiplist

Linux is 3.2.29 (Slackware 14.0)

So unless one of my patches is breaking something, I suspect that there
is a bug in cyrus-imap.

Thanks,
schu





More information about the Info-cyrus mailing list