summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/orchestrator.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-02-15 09:47:43 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-02-15 10:45:20 +0100
commitd21a9aeab8c68f0b84c479ff143c02658f9eda7f (patch)
treed3b16a9d014d92b6aea1b719086cadc2cf8a623b /src/orchestrator/orchestrator.rs
parent1447fc3674a376eef93873e1f18bedd633d870a2 (diff)
Fix: Return script errors properly
This patch fixes error returning from the JobHandle::run() implementation. Somehow, in the many rewrites, the error returning resulted in code that did not differentiate between script run errors and scheduling errors. This patch fixes this by making the JobHandle::run() method return Result<Result<Vec<ArtifactPath>>> whereas the outer error is the scheduling result and the inner error is the script result. The calling code was adapted accordingly. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/orchestrator/orchestrator.rs')
-rw-r--r--src/orchestrator/orchestrator.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index 2860748..a9b1e19 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -595,9 +595,7 @@ impl<'a> JobTask<'a> {
let job_uuid = *self.jobdef.job.uuid();
// Schedule the job on the scheduler
- match self.scheduler.schedule_job(runnable, self.bar.clone()).await?.run().await {
- // if the scheduler run reports an error,
- // that is an error from the actual execution of the job ...
+ match self.scheduler.schedule_job(runnable, self.bar.clone()).await?.run().await? {
Err(e) => {
trace!("[{}]: Scheduler returned error = {:?}", self.jobdef.job.uuid(), e);
// ... and we send that to our parent
@@ -607,6 +605,7 @@ impl<'a> JobTask<'a> {
let mut errormap = HashMap::with_capacity(1);
errormap.insert(job_uuid, e);
self.sender[0].send(Err(errormap)).await?;
+ return Ok(())
},
// if the scheduler run reports success,