Skip to content

Commit 2097f8a

Browse files
committed
Clear server pool when a server is marked unknown
1 parent 04ca01a commit 2097f8a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mongo/server.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,11 @@ def unknown!
474474

475475
# @api private
476476
def update_description(description)
477+
clear_pool = @pool && description.unknown? && !@description.unknown?
477478
@description = description
479+
if clear_pool
480+
@pool.disconnect!
481+
end
478482
end
479483

480484
# @api private

0 commit comments

Comments
 (0)