From: Nikodemus S. <nik...@ra...> - 2008-11-06 14:24:48
|
On Thu, Nov 6, 2008 at 3:03 PM, Nikodemus Siivola <nik...@ra...> wrote: > While stressing SBCL threads with hunchentoot & drakma I frequently > see connect() returning -1 & EINTR in SB-BSD-SOCKETS -- which SBCL > currently considers an error. > > I am not a network hacker by any measure, so I would much appreciate > it if someone could tell me if just retrying connect() on EINTR is > sane? The attached patch does this. Some more detail: EINTR can be caused by eg. GC triggered by another thread (thanks to SIG_STOP_FOR_GC being sent to all threads.) This is what I believe I was seeing, and SB-SPROF is another likely source of similar havoc. (Situations under which EINTR occurs in the real world are probably platform dependant.) I don't see how user of SB-BSD-SOCKETS can reasonably deal with EINTR except by (a) panicking for no good reason (b) retrying. Hence the patch. However, since I am not familiar with network programming idioms, I am mostly wondering if there are eg. cases where it is common to depend on <SOMETHING> causing connect() to fail with EINTR instead of trying till timeout is reached, etc. > Cheers, > > -- Nikodemus |