Join GitHub today
Fixes issue #549 (OpenSSL sockets spin indefinitely on timeout in handshake) #554
This pull request fixes Issue #549 (OpenSSL sockets spin indefinitely on timeout in handshake)
The only place that uses the return value of flushData can go into an infinite loop, and does so in production.
Just swapping the return values from flushData fixes the problem, and doesn't have any knock on effects we can find.
referenced this pull request
Mar 15, 2013
Hmm, I thought I had a working test case (below), which hangs indefinitely despite the timeout. However, the fix doesn't seem to fix this reliably, so there may be other issues.
I'll try and find a better reproduction. Meanwhile, could someone have a look at the logic of this patch as it would be nice to be able to get our production servers back onto the released gem?
@robinmessage I tried your script and it did not appear to hang for me on JRuby master after several attempts.
I will have a look at the logic of the patch.
@robinmessage Your patch does seem right...kinda one of those duh moments. The logic should be that it continues trying to flushData until there's none left to flush, so obviously it should return true when there's data left. We probably didn't run into it under normal circumstances because everything flushes ok.