followup: stuck lmtpd processes

Rob Siemborski rjs3 at andrew.cmu.edu
Wed Sep 24 11:27:46 EDT 2003


On Wed, 24 Sep 2003, Etienne Goyer wrote:

> The obvious solution is to not use alarm() to interrupt blocking
> syscall, but to use non-blocking call with select() instead.  I
> am not a very proficient C Unix programmer, so maybe this suggestion
> make no sense.  However, in the case of the bug with fud I discussed in
> another post, it was a perfectly workable solution.

This is *not* the correct solution.

However, I have looked into this and to my surprise, Linux is indeed
restarting the system calls instead of returning with EINTR.  However, the
answer here is to set up the alarm() handler with sigaction without
setting SA_RESTART, not to jump through select() hoops or make nonblocking
lock attempts.

I'll work on fixing fud shortly (its using signal() and it should be
using sigaction()).

> And please don't scoff it as "a problem with Linux, not Cyrus".  Linux
> may well be broken (I can't tell), but it still constitute the vast
> majority of Cyrus installation (I would believe), and thus merit to be
> accomodated.

Linux should certainly be accomodated, but not in a way that causes
*severe* performance penalties on operating systems that don't
mysteriously fall asleep in the middle of a blocking flock() or fcntl()
call.

-Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
Research Systems Programmer * /usr/contributed Gatekeeper





More information about the Info-cyrus mailing list