Skip to content

Commit f6df3db

Browse files
author
Bulat Shakirzyanov
committed
[RUBY-125] avoid deadlocks during cleanup on connection fail
1 parent a28ec8c commit f6df3db

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/cassandra/cluster/control_connection.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ def connect_async
6060
plan = @load_balancing_policy.plan(nil, VOID_STATEMENT, VOID_OPTIONS)
6161
connect_to_first_available(plan)
6262
end
63-
f.on_failure do |e|
64-
close_async
65-
end
6663
f
6764
end
6865

lib/cassandra/driver.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ def connect(addresses)
148148
promise.fulfill(cluster)
149149
else
150150
f.on_failure do |e|
151-
cluster.close_async.on_complete do |_, _|
152-
promise.break(e)
153-
end
151+
cluster.close_async
152+
promise.break(e)
154153
end
155154
end
156155
end

0 commit comments

Comments
 (0)