Skip to content

Commit

Permalink
Notify the scheduler when a failed job completes. See crossbeam-rs#477
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanchester committed Aug 1, 2019
1 parent 6ba6f6c commit f988cf9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/bin/sccache-dist/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,20 +792,21 @@ impl ServerIncoming for Server {
requester
.do_update_job_state(job_id, JobState::Started)
.chain_err(|| "Updating job state failed")?;
let tc = match self.job_toolchains.lock().unwrap().remove(&job_id) {
Some(tc) => tc,
None => return Ok(RunJobResult::JobNotFound),
let res = match self.job_toolchains.lock().unwrap().remove(&job_id) {
None => Ok(RunJobResult::JobNotFound),
Some(tc) => {
match self.builder.run_build(tc, command, outputs, inputs_rdr, &self.cache) {
Err(e) => Err(e.chain_err(|| "run build failed")),
Ok(res) => Ok(RunJobResult::Complete(JobComplete {
output: res.output,
outputs: res.outputs,
})),
}
},
};
let res = self
.builder
.run_build(tc, command, outputs, inputs_rdr, &self.cache)
.chain_err(|| "run build failed")?;
requester
.do_update_job_state(job_id, JobState::Complete)
.chain_err(|| "Updating job state failed")?;
Ok(RunJobResult::Complete(JobComplete {
output: res.output,
outputs: res.outputs,
}))
return res;
}
}

0 comments on commit f988cf9

Please sign in to comment.