diff --git a/lib/xandra/cluster/pool.ex b/lib/xandra/cluster/pool.ex index 1db42fd2..aa94ccca 100644 --- a/lib/xandra/cluster/pool.ex +++ b/lib/xandra/cluster/pool.ex @@ -357,6 +357,20 @@ defmodule Xandra.Cluster.Pool do {:next_state, :has_connected_once, data, actions} end + # Sent by the connection itself. + def handle_event( + :info, + {:xandra, :disconnected, peername, _pid}, + _state, + %__MODULE__{} = data + ) + when is_peername(peername) do + # Not connected anymore, but we're not really sure if the whole host is down. + data = put_in(data.peers[peername].status, :up) + data = stop_pool(data, data.peers[peername].host) + {:keep_state, data} + end + # Sent by the connection itself. def handle_event( :info,