View Source Cluster.Strategy.EC2Tag.Blacklist (libcluster_ec2_tag_strategy v0.1.5)

Tracks repeated connect failures per node and temporarily removes failing nodes from the dial list.

A node that fails :connect_failure_threshold consecutive connect attempts is blacklisted for :blacklist_retry_interval milliseconds. Once the interval expires the node is allowed through again on the next cycle as a probe: a successful connect clears all state for the node, another failure re-blacklists it immediately (the failure count is retained while blacklisted).

This keeps a foreign or misconfigured node (wrong Erlang cookie, blocked distribution port) from being hammered every poll cycle forever, which both floods logs with handshake rejections and can feed :global's overlapping-partition prevention with permanently half-connected views.

Link to this section Summary

Functions

Drops tracking state for nodes that are no longer discovered, so the maps cannot grow unbounded as instances come and go.

Records the outcome of a connect cycle. attempted is every node that was dialed this cycle, failed_nodes the subset that failed to connect.

Splits candidate nodes into {allowed, blocked}. Blacklisted nodes whose retry time has passed are allowed through as probes.

Link to this section Types

@type t() :: %Cluster.Strategy.EC2Tag.Blacklist{
  blacklist: %{required(node()) => integer()},
  failures: %{required(node()) => pos_integer()}
}

Link to this section Functions

Link to this function

drop_undiscovered_nodes(blacklist, discovered_nodes)

View Source

Drops tracking state for nodes that are no longer discovered, so the maps cannot grow unbounded as instances come and go.

Link to this function

record_connect_results(tracker, attempted, failed_nodes, now, opts)

View Source

Records the outcome of a connect cycle. attempted is every node that was dialed this cycle, failed_nodes the subset that failed to connect.

Options:

  • :threshold - consecutive failures before a node is blacklisted. Pass :infinity to disable blacklisting.
  • :retry_interval - milliseconds a blacklisted node is skipped before the next probe.
Link to this function

split_into_allowed_and_blocked(blacklist, nodes, now)

View Source

Splits candidate nodes into {allowed, blocked}. Blacklisted nodes whose retry time has passed are allowed through as probes.