From 4e6ec700c7d0c26425a916d10eb2648617e39c8d Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 3 Jan 2024 12:04:53 +0000 Subject: [PATCH] Handle new aten:[un]register return values. --- src/ra_server_proc.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ra_server_proc.erl b/src/ra_server_proc.erl index d82f6925..7b20b154 100644 --- a/src/ra_server_proc.erl +++ b/src/ra_server_proc.erl @@ -1486,7 +1486,7 @@ follower_leader_change(Old, #state{pending_commands = Pending, LeaderNode = ra_lib:ra_server_id_node(NewLeader), ok = aten_register(LeaderNode), OldLeaderNode = ra_lib:ra_server_id_node(OldLeader), - ok = aten:unregister(OldLeaderNode), + _ = aten:unregister(OldLeaderNode), ok = record_leader_change(NewLeader, New), % leader has either changed or just been set ?INFO("~ts: detected a new leader ~w in term ~b", @@ -1502,7 +1502,12 @@ aten_register(Node) -> case node() of Node -> ok; _ -> - aten:register(Node) + case aten:register(Node) of + ignore -> + ok; + Res -> + Res + end end. swap_monitor(MRef, L) ->