File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Bug Fixes:
1212* [ RUBY-102] Allow custom types in schema metadata
1313* [ RUBY-97] Allow disabling of the initial population of schema metadata
1414* [ RUBY-95] Speed up generation of large token maps
15+ * [ RUBY-116] fix thread leak on connection error
1516
1617Breaking Changes:
1718
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ def self.cluster_async(options = {})
507507
508508 hosts . shuffle!
509509 rescue => e
510- futures = options . fetch ( :futures_factory ) { Driver . new . futures_factory }
510+ futures = options . fetch ( :futures_factory ) { return Future :: Error . new ( e ) }
511511 futures . error ( e )
512512 else
513513 driver = Driver . new ( options )
Original file line number Diff line number Diff line change @@ -145,7 +145,11 @@ def connect(addresses)
145145 if f . resolved?
146146 promise . fulfill ( cluster )
147147 else
148- f . on_failure { |e | promise . break ( e ) }
148+ f . on_failure do |e |
149+ cluster . close_async . on_complete do |_ , _ |
150+ promise . break ( e )
151+ end
152+ end
149153 end
150154 end
151155
You can’t perform that action at this time.
0 commit comments