Bernd Wurst writes:
But nevertheless, the moment when imapd is handed over from couriertls to init should be caught and lead to a real crash or a ordered shutdown of the specific imapd process. Don't know how this is meant by FAM/gamin but I hope there is any possibility to check if the FAM crashed!
None that I know of. Applications do not talk to FAM or Gamin directly. Applications use a library API, a set of library functions that applications use. It's the FAM or the Gamin library manages all communications with the server.
The first thing you should check is whether you're using the current Gamin library, and that you are not affected by some bug that's already fixed.
The other situation where something like this might happen, that I can think of, is Linux running out of system RAM, and the OOM killer getting activated and deciding to kill the Gamin process, thus screwing up the Gamin library.
I would tend to think that the library should really be prepared to handle the possibility of the server process dying in some meaningful fashion, even only if returning an error code to the application, instead of hanging forever. That's not good. An application would rather get an error code, instead of having the Gamin library hang. If the root cause here is indeed the Gamin server process dying, I'd drop a note to Gamin and suggest that the library might want to handle the eventuality of not being able to connect to the server process.
The only thing I can think of doing myself is something like the following. If FAMOpen(), where presumably it's hanging trying to connect to a nonexistent server, does not return in 15 seconds, the process should get a SIGHUP and die.
This is not going to really fix anything, the connecting IMAP client will end up getting a dropped connection, but this should stop the IMAP server processes from accumulating.
Index: maildir/maildirwatch.c
===================================================================
RCS file: /cvsroot/courier/libs/maildir/maildirwatch.c,v
retrieving revision 1.10
diff -U3 -r1.10 maildirwatch.c
--- maildir/maildirwatch.c 10 Nov 2004 01:01:40 -0000 1.10
+++ maildir/maildirwatch.c 13 Jul 2010 22:21:46 -0000
@@ -59,12 +59,14 @@
maildirwatch_currentfam->broken=0;
maildirwatch_currentfam->refcnt=0;
+ alarm(15);
if (FAMOpen(&maildirwatch_currentfam->fc) < 0)
{
errno=EIO;
free(maildirwatch_currentfam);
maildirwatch_currentfam=NULL;
}
+ alarm(0);
}
}
pgpJHcnogBaoB.pgp
Description: PGP signature
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
