Skip to content

rabbit_peer_discovery: Handle error/timeout when querying cluster members#15568

Merged
dumbbell merged 1 commit intomainfrom
handle-error-when-querying-cluster-members-in-peer-discovery
Feb 26, 2026
Merged

rabbit_peer_discovery: Handle error/timeout when querying cluster members#15568
dumbbell merged 1 commit intomainfrom
handle-error-when-querying-cluster-members-in-peer-discovery

Conversation

@dumbbell
Copy link
Copy Markdown
Collaborator

Why

If rabbit_mnesia:members/0 hit an error, it always returned the node itself.

rabbit_khepri:members/0 returns an empty list to distinguish an error and let the caller handle it.

When peer discovery queries the cluster members ant it fails, it didn't handle the empty list so far. This led to errors while sorting nodes to determine which one to use as the cluster seed.

How

If rabbit_nodes:list_members/0 returns an empty list, the code assumes that the node is alone/unclustered (i.e. like what would be implicitly done if Mnesia was used).

…bers

[Why]
If `rabbit_mnesia:members/0` hit an error, it always returned the node
itself.

`rabbit_khepri:members/0` returns an empty list to distinguish an error
and let the caller handle it.

When peer discovery queries the cluster members ant it fails, it didn't
handle the empty list so far. This led to errors while sorting nodes to
determine which one to use as the cluster seed.

[How]
If `rabbit_nodes:list_members/0` returns an empty list, the code assumes
that the node is alone/unclustered (i.e. like what would be implicitly
done if Mnesia was used).
@dumbbell dumbbell self-assigned this Feb 26, 2026
@dumbbell dumbbell marked this pull request as ready for review February 26, 2026 09:50
@dumbbell dumbbell merged commit a31e3ed into main Feb 26, 2026
184 checks passed
@dumbbell dumbbell deleted the handle-error-when-querying-cluster-members-in-peer-discovery branch February 26, 2026 09:50
@dumbbell dumbbell added this to the 4.3.0 milestone Feb 26, 2026
dumbbell added a commit that referenced this pull request Feb 26, 2026
rabbit_peer_discovery: Handle error/timeout when querying cluster members (backport #15568)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant