minor: JRUBY hacks

This commit is contained in:
Tyler Brock 2012-05-15 15:41:57 -04:00
parent 746687bb86
commit 9b38c3a70f

View File

@ -70,10 +70,14 @@ module Mongo
if ready if ready
begin begin
@socket.sysread(maxlen, buffer) @socket.sysread(maxlen, buffer)
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE, Errno::ETIMEDOUT, EOFError rescue SystemCallError => ex
raise ConnectionFailure # Needed because sometimes JRUBY doesn't throw Errno::ECONNRESET as it should
rescue Errno::EINTR, Errno::EIO, IOError # http://jira.codehaus.org/browse/JRUBY-6180
raise OperationFailure raise ConnectionFailure, ex
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE, Errno::ETIMEDOUT, EOFError => ex
raise ConnectionFailure, ex
rescue Errno::EINTR, Errno::EIO, IOError => ex
raise OperationFailure, ex
end end
else else
raise OperationTimeout raise OperationTimeout