diff --git a/lib/mongo/networking.rb b/lib/mongo/networking.rb index 62cee62..97cc7ea 100644 --- a/lib/mongo/networking.rb +++ b/lib/mongo/networking.rb @@ -140,6 +140,11 @@ module Mongo rescue SystemStackError, NoMemoryError, SystemCallError => ex close raise ex + rescue Exception => ex + if defined?(IRB) + close if ex.class == IRB::Abort + end + raise ex ensure if should_checkin if command || read == :primary