Closed Mask closed 9 years ago
I get the following failure on this test on OS X:
1) Reel::Connection resets if client dropped connection
Failure/Error: connection.respond :ok, ("Some Big Response sent"*100000)
Errno::EPROTOTYPE:
Protocol wrong type for socket
# ./lib/reel/response/writer.rb:31:in `write'
Interesting - I'm developing with MRI 2.0.0p481 on OSX 10.9.5 and can't reproduce this. With which ruby does this happen?
Originally 2.2.0, but I get it with 2.0.0-p451 as well
are you using Yosemite by any chance? We could be running into this: http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ TL;DR: Apple changed the call to send() in OSX 10.10 - it can now return EPROTOTYPE if you try to write to a socket which is closing.
I am indeed using Yosemite
Ok, I took this as an opportunity/excuse to update to Yosemite and can now reproduce this. If only happens maybe 20% of the time, so there's a race condition in there somewhere. Anyway, including EPROTOTYPE in the exception list seems to help.
BTW: this is actually completely unrelated to the original topic #150, which was a celluloid/reel state problem. It's a pure coincidence that the additional test happened to uncover this issue with yosemite.
(hit wrong button)
I was wondering why other ruby-based servers aren't haveing this problem, so I looked into the puma sources. They simply catch
rescue Errno::EPIPE, SystemCallError, IOError
An unexpected EPROTOTYPE
will be handled as a generic SystemCallError
- should we do this too? What do you think?
:+1:
previous PR didn't include the migration to new rspec