[Haskell-cafe] Re: sendfile leaking descriptors on Linux?
spam at scientician.net
Tue Feb 16 16:48:14 EST 2010
Taru Karttunen wrote:
> Excerpts from Bardur Arantsson's message of Tue Feb 16 22:57:23 +0200 2010:
>> As far as I can tell, all nonblocking networking code is vulnerable to
>> this issue (unless it actually does use threadWaitRead, obviously :)).
> There are a few easy fixes:
> 1) socket timeouts with Network.Socket.setSocketOption
The whole point of this thread is that this isn't sufficent.
> 2) just make your server code have timeouts in Haskell
> This cannot be fixed in the sendfile library, it is a
> feature of TCP that connections may linger for a long
> time unless explicit timeouts are used.
The problem is that the sendfile library *doesn't* wake
up when the connection is terminated (because of threadWaitWrite)
-- it doesn't matter what the timeout is.
Client code of the sendfile library shouldn't have to try
to work around this -- it's absurd to expect it to.
Please read the entire thread.
More information about the Haskell-Cafe