summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-02-02 09:15:20 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-02-02 09:19:26 +0100
commitc0b7d3433b19c0bf256c0619426c204ce79b678c (patch)
tree1e4721cde2fce94af2cb0e0b822cddad47c2f0ce /src
parent061c4d43cc028d41a13d13f101eec2dbceea0d78 (diff)
Fix: Receive artifacts _after_ checking whether jobs resulted in error
This caused the program never to return if the running jobs resulted in an error and no artifact being sent to the parent - which caused the tokio::join!() to never return, thus the futures not to be pulled and thus the whole program sleep in an strange state which looked like some filesystem operations did not return. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src')
-rw-r--r--src/orchestrator/orchestrator.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index 7220c9a..00cec75 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -314,12 +314,10 @@ impl<'a> Orchestrator<'a> {
.collect::<futures::stream::FuturesUnordered<_>>()
.collect::<Result<()>>();
- let root_recv = root_receiver.recv();
let multibar_block = tokio::task::spawn_blocking(move || multibar.join());
-
- let (root_recv, _, jobs_result) = tokio::join!(root_recv, multibar_block, running_jobs);
+ let (_, jobs_result) = tokio::join!(multibar_block, running_jobs);
let _ = jobs_result?;
- match root_recv {
+ match root_receiver.recv().await {
None => Err(anyhow!("No result received...")),
Some(Ok((_, artifacts))) => Ok((artifacts, vec![])),
Some(Err(errors)) => Ok((vec![], errors)),