Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: allow only one relocation at the time per node
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam committed Jan 18, 2021
1 parent 33eac1b commit 0e4d05f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/routing/approved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,14 +837,21 @@ impl Approved {
}

debug!(
"Received Relocate message to join the section at {}.",
"Received Relocate message to join the section at {}",
details.relocate_details().destination
);

if self.relocate_state.is_none() {
self.send_event(Event::RelocationStarted {
previous_name: self.node.name(),
});
match self.relocate_state {
Some(RelocateState::InProgress(_)) => {
trace!("Ignore Relocate - relocation already in progress");
return None;
}
Some(RelocateState::Delayed(_)) => (),
None => {
self.send_event(Event::RelocationStarted {
previous_name: self.node.name(),
});
}
}

let (message_tx, message_rx) = mpsc::channel(1);
Expand Down

0 comments on commit 0e4d05f

Please sign in to comment.