Skip to content

Commit

Permalink
add comments for why we're maybe_start_pools/1 after stop_pool/1
Browse files Browse the repository at this point in the history
  • Loading branch information
harunzengin committed Dec 11, 2024
1 parent 579ea7d commit 344ec94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/xandra/cluster/pool.ex
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ defmodule Xandra.Cluster.Pool do
# Not connected anymore, but we're not really sure if the whole host is down.
data = set_host_status(data, peername, :up)
data = stop_pool(data, data.peers[peername].host)
# There might be more hosts that we could connect to instead of the stopped one
data = maybe_start_pools(data)
{:keep_state, data}
end
Expand All @@ -334,6 +335,7 @@ defmodule Xandra.Cluster.Pool do
data = set_host_status(data, peername, :down)
host = data.peers[peername].host
data = stop_pool(data, host)
# There might be more hosts that we could connect to instead of the stopped one
data = maybe_start_pools(data)
{:keep_state, data}
else
Expand Down

0 comments on commit 344ec94

Please sign in to comment.