Skip to content

Commit

Permalink
Merge pull request #294 from rabbitmq/fix-reset-race-condition
Browse files Browse the repository at this point in the history
khepri_cluster: Fix race condition in the reset code
  • Loading branch information
dumbbell committed Sep 11, 2024
2 parents c5722bf + 8491582 commit 80ef2a3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/khepri_cluster.erl
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,20 @@ do_reset(RaSystem, StoreId, ThisMember, Timeout) ->
?LOG_DEBUG(
"The local Ra server exited while we were waiting "
"for it to be ready for a membership change. It "
"means it was removed from the cluster by the remote "
"cluster; we can proceed with the reset."),
"means it was removed from the cluster by another "
"member; we can proceed with the reset."),
forget_store(StoreId),
ok
end;
{timeout, _} ->
{error, timeout};
{error, noproc} ->
?LOG_DEBUG(
"The local Ra server exited while we tried to detach it from "
"its cluster. It means it was removed from the cluster by "
"another member; we can proceed with the reset."),
forget_store(StoreId),
ok;
{error, _} = Error ->
Error
end.
Expand Down

0 comments on commit 80ef2a3

Please sign in to comment.