Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/taurus/src/app/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ pub fn spawn_worker(
sub_flow_execution_closed = true;
log::info!("NATS worker received shutdown signal");
}
// Reclaim finished tasks as they complete. Without this arm
// `in_flight` only drains after the loop exits (shutdown),
// so every completed execution's `JoinSet` entry would sit
// unreclaimed for the process's entire lifetime -- memory
// climbing with every execution and never coming back down.
Some(result) = in_flight.join_next(), if !in_flight.is_empty() => {
if let Err(err) = result {
log::error!("In-flight execution task panicked or was cancelled: {:?}", err);
}
}
}
}

Expand Down