Skip to content

Commit

Permalink
Ignore heartbeats from self in gossip strategy. (bitwalker#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
doughsay authored and bitwalker committed Aug 4, 2017
1 parent df43178 commit d7a7547
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/strategy/gossip.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ defmodule Cluster.Strategy.Gossip do
# is different, and thus a node we can ignore
@spec handle_heartbeat(State.t, binary) :: :ok
defp handle_heartbeat(%State{connect: connect, list_nodes: list_nodes} = state, <<"heartbeat::", rest::binary>>) do
self = node()
case :erlang.binary_to_term(rest) do
%{node: ^self} ->
:ok
%{node: n} when is_atom(n) ->
debug state.topology, "received heartbeat from #{n}"
Cluster.Strategy.connect_nodes(state.topology, connect, list_nodes, [n])
Expand Down

0 comments on commit d7a7547

Please sign in to comment.