Skip to content

rabbit_khepri: Fix error handling with net_adm:ping/1 #9929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Nov 16, 2023

Why

The initial implementation was a bit too optimistic: it just asserted that net_adm:ping/1 returned pong. This led to a crash if it was not the case.

How

It is better to handle an error from net_adm:ping/1 and return something appropriate instead of crashing. The rest of the function already does that.

It improves the integration with peer discovery.

@dumbbell dumbbell added this to the 3.13.0 milestone Nov 16, 2023
@dumbbell dumbbell self-assigned this Nov 16, 2023
[Why]
The initial implementation was a bit too optimistic: it just asserted
that `net_adm:ping/1` returned pong. This led to a crash if it was not
the case.

[How]
It is better to handle an error from `net_adm:ping/1` and return
something appropriate instead of crashing. The rest of the function
already does that.

It improves the integration with peer discovery.
@dumbbell dumbbell force-pushed the fix-error-handling-in-rabbit_khepri-add_member branch from c6ca320 to 4ebaf7d Compare November 16, 2023 11:48
@dumbbell dumbbell marked this pull request as ready for review November 16, 2023 12:23
@dumbbell dumbbell merged commit 1af161a into main Nov 16, 2023
@dumbbell dumbbell deleted the fix-error-handling-in-rabbit_khepri-add_member branch November 16, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant