On 14/09/2014 20:33, Ángel González wrote:
> Sam Varshavchik wrote
>> Ángel González writes:
>>
>>> Kees Bakker wrote:
>>>> * maildir/maildirwatch.c (maildirwatch_alloc): Use alarm() to kill
>>>>    the process if FAMOpen() takes more than 15 seconds to return.
>>>>    Should prevent a hung process if FAM/Gamin is fubared.
>>> Seems that a signal(SIGALRM, SIG_IGN); would have been a appropiate. If
>>> FAMOpen
>>> failed with EINTR, courier would have been able to continue without dying.
>> No. The process is stuck somewhere in the innards of the gamin library.
>> Something is fundamentally broken with gamin on some Linux distros, but not
>> on others. Gamin on Fedora is just fine, but, apparently, on Debian and
>> Debian derivatives it keeps getting hung when opening a domain socket. The
>> process will hang forever, until something kills it.
> My point was that the piece inside fam where it got stuck is a
> connect(2). A signal(SIGALRM, SIG_IGN);* would make the connect() fail
> with EINTR, and assuming that fam would return to the caller, that would
> end up at the if (< 0) path.
>
> * Actually, it would be better to use sigaction() in order to ensure it
> doesn't have SA_RESTART flag (signal(2) may have both behaviors).
>
> However, the proposal of printing an error message and exit() may be a
> better idea.
>
> Kees patch looks good to me (although the signum comparison is
> redundant).
>
One small nit, alarm(0) should be called before removing the
signal handler, otherwise it might trigger right between those
two lines, which will be very hard to debug.

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  http://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to