Skip to content

Commit 4a7f903

Browse files
p-mongop
andauthored
RUBY-2132 disconnect monitoring connection on error (#1939)
Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com>
1 parent 7233af7 commit 4a7f903

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/mongo/server/monitor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def ismaster
262262
message = @connection.dispatch_bytes(Monitor::Connection::ISMASTER_BYTES)
263263
message.documents.first
264264
rescue Mongo::Error
265+
@connection.disconnect!
265266
@connection = nil
266267
raise
267268
end

0 commit comments

Comments
 (0)