Browse Source

Fix dora list listing twice a stopping dataflow when using multiple daemon. (#668)

Previously, When a daemon stop it sends a message to the coordinator
which will log it as an archived dataflow even though not every daemon
has stopped within the dataflow.

This PR should fix this issue.
tags/v0.3.7rc0
Philipp Oppermann GitHub 1 year ago
parent
commit
3d6360ddab
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      binaries/coordinator/src/lib.rs

+ 12
- 6
binaries/coordinator/src/lib.rs View File

@@ -269,16 +269,22 @@ async fn start_inner(
DataflowEvent::DataflowFinishedOnMachine { machine_id, result } => {
match running_dataflows.entry(uuid) {
std::collections::hash_map::Entry::Occupied(mut entry) => {
// Archive finished dataflow
archived_dataflows
.entry(uuid)
.or_insert_with(|| ArchivedDataflow::from(entry.get()));
entry.get_mut().machines.remove(&machine_id);
let dataflow = entry.get_mut();
dataflow.machines.remove(&machine_id);
tracing::info!(
"removed machine id: {machine_id} from dataflow: {:#?}",
dataflow.uuid
);
dataflow_results
.entry(uuid)
.or_default()
.insert(machine_id, result);
if entry.get_mut().machines.is_empty() {

if dataflow.machines.is_empty() {
// Archive finished dataflow
archived_dataflows
.entry(uuid)
.or_insert_with(|| ArchivedDataflow::from(entry.get()));
let finished_dataflow = entry.remove();
let reply = ControlRequestReply::DataflowStopped {
uuid,


Loading…
Cancel
Save