diff --git a/src/runtime2/component/consensus.rs b/src/runtime2/component/consensus.rs index 4683ff164f11a5d64815a14a18ef5d94395ad24e..666ecf3c637103d1c7646b01252373c244637536 100644 --- a/src/runtime2/component/consensus.rs +++ b/src/runtime2/component/consensus.rs @@ -30,6 +30,8 @@ enum Mode { NonSync, SyncBusy, SyncAwaitingSolution, + SelectBusy, + SelectWait, } struct SolutionCombiner { @@ -99,7 +101,7 @@ impl SolutionCombiner { /// Combines the currently stored global solution (if any) with the newly /// provided local solution. Make sure to check the `has_decision` return /// value afterwards. - fn combine_with_local_solution(&mut self, comp_id: CompId, solution: SyncLocalSolution) { + fn combine_with_local_solution(&mut self, _comp_id: CompId, solution: SyncLocalSolution) { debug_assert_ne!(self.solution.decision, SyncRoundDecision::Solution); // Combine partial solution with the local solution entries @@ -422,6 +424,19 @@ impl Consensus { self.highest_id = header.highest_id; for peer in comp_ctx.iter_peers() { if peer.id == header.sending_id { + continue; // do not send to sender: it has the higher ID + } + + // also: only send if we received a message in this round + let mut performed_communication = false; // TODO: Revise, temporary fix + for port in self.ports.iter() { + if port.peer_comp_id == peer.id && port.mapping.is_some() { + performed_communication = true; + break; + } + } + + if !performed_communication { continue; }