Skip to content

Commit ca6f4ec

Browse files
committed
RUBY-433 prevent additonal possible IOError
1 parent 0bd7d38 commit ca6f4ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/mongo/connection.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ def check_is_master(node)
629629
rescue OperationFailure, SocketError, SystemCallError, IOError
630630
close
631631
ensure
632-
socket.close if socket
632+
if socket
633+
socket.close unless socket.closed?
634+
end
633635
end
634636

635637
config

0 commit comments

Comments
 (0)