[Haskell-cafe] Re: sendfile leaking descriptors on Linux?
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Fri Feb 5 19:24:17 EST 2010
On Feb 5, 2010, at 02:56 , Bardur Arantsson wrote:
> I should have posted this earlier, but the exact message I'm seeing
> in the case where the Bad Client disconnects is this:
> hums: Network.Socket.SendFile.Linux: resource vanished (Broken pipe)
> Oddly, I haven't been able to reproduce this using a wget client
> with a ^C during transfer. When I "disconnect" wget with ^C or
> "pkill wget" or even "pkill -9 wget", I get this message:
> hums: Network.Socket.SendFile.Linux: resource vanished (Connection
> reset by peer)
> (and no leak, as observed by "lsof | grep hums").
"Broken pipe" is normally handled as a signal, and is only mapped to
an error if SIGPIPE is set to SIG_IGN. I can well imagine that the
SIGPIPE signal handler isn't closing resources properly; a workaround
would be to use the System.Posix.Signals API to ignore SIGPIPE, but I
don't know if that would work as a general solution (it would depend
on what other uses of pipes/sockets exist).
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100205/cc1a30d7/PGP.bin
More information about the Haskell-Cafe