[Haskell-cafe] Re: sendfile leaking descriptors on Linux?
taruti at taruti.net
Thu Feb 18 10:53:23 EST 2010
Excerpts from Bardur Arantsson's message of Wed Feb 17 21:27:07 +0200 2010:
> For sendfile, a timeout of 1 second would probably be fine. The *ONLY*
> purpose of threadWaitWrite in the sendfile code is to avoid busy-waiting
> on EAGAIN from the native sendfile.
Of course this will kill connections for all clients that may have a
two second network hickup.
> How so? As a user I expect sendfile to work and not semi-randomly block
> threads indefinitely.
If you want sending something to terminate you will add a timeout to
it. A nasty client may e.g. take one byte each minute and sending your
file may take a few years.
- Taru Karttunen
More information about the Haskell-Cafe