Closed NicolasT closed 10 years ago
@NicolasT thanks for catching this! It is certainly a bug, and your diagnostic seems accurate. I'll fix it right away.
@NicolasT this should be fixed by https://github.com/k0001/pipes-network/commit/ad5a52d836891a5e9bf08861cba4212008fe8b6c
Do you mind if I add your name to the PEOPLE
file as a small “thank you”?
I'm closing this, please reopen if the issue is still present.
Thanks for the swift response & fix. I don't mind any thank you, but don't feel obliged either ;-)
Thanks,
Nicolas
Just so you know, I'll delay shipping this to Hackage a bit because I want to go over the list of open issues and fix some of them.
After making a seemingly trivial change from
fromSocket
tofromSocketTimeout
in an application, my app started to consume 100% CPU after a client connected and disconnected.When checking what was going on using
strace
, I noticed lots ofread
(orrecvmsg
, can't remember exactly) calls returning 0 bytes, denoting EOF.When checking the
pipes-network
code, I saw thefromSocket
code correctly detects a 0-length read, then closes the producer. Turns out the functions with timeout enabled don't, they pass the (empty) bytestring downstream and loop.I believe that's a bug?