Skip to content

Commit

Permalink
ensure pending LeaseAck is sent after the managers are registered
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonHartley committed Feb 5, 2024
1 parent c338a7c commit 2ffbaa3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions coerce/src/remote/cluster/singleton/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,6 @@ impl<F: SingletonFactory> Handler<Receive<SystemTopic>> for Manager<F> {
leader_id: leader,
nodes,
}) => {
match mem::replace(&mut self.state, State::Idle) {
State::Joining {
acknowledgement_pending: Some(node_id),
} => {
self.notify_manager(
node_id,
LeaseAck {
source_node_id: self.node_id,
},
ctx,
)
.await;
}
_ => {}
}

debug!(
leader = leader,
nodes_len = nodes.len(),
Expand All @@ -321,6 +305,22 @@ impl<F: SingletonFactory> Handler<Receive<SystemTopic>> for Manager<F> {
);
}

match mem::replace(&mut self.state, State::Idle) {
State::Joining {
acknowledgement_pending: Some(node_id),
} => {
self.notify_manager(
node_id,
LeaseAck {
source_node_id: self.node_id,
},
ctx,
)
.await;
}
_ => {}
}

if leader == &self.node_id {
self.begin_starting(ctx).await;
}
Expand Down

0 comments on commit 2ffbaa3

Please sign in to comment.