Skip to content

Commit e339585

Browse files
Fix another stall bug
If a task fails to get marked as failed (for whatever reason), we still want to delete it from the task graph. Otherwise it'll get left in the task graph and we'll eventually block on its completion (it's marked as running).
1 parent e8f8ace commit e339585

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/runner/graph.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,24 @@ impl TasksGraph {
230230
self.mark_as_failed(child, ex, db, state, config, error, result, worker)?;
231231
}
232232

233-
match self.graph[node] {
233+
// We need to mark_as_completed the node here (if it's a task),
234+
// otherwise we'll later get stuck as the node is still considered
235+
// running (but has actually failed).
236+
let res = match self.graph[node] {
234237
Node::Task { ref task, .. } => {
235238
log::debug!("marking task {:?} as failed", task);
236-
task.mark_as_failed(ex, db, state, config, error, result)?
239+
let res = task.mark_as_failed(ex, db, state, config, error, result);
240+
if let Err(err) = &res {
241+
log::debug!("marking task {:?} as failed, failed: {:?}", task, err);
242+
}
243+
res
237244
}
238245
Node::CrateCompleted | Node::Root => return Ok(()),
239-
}
246+
};
240247

241248
self.mark_as_completed(node);
242-
Ok(())
249+
250+
res
243251
}
244252

245253
pub(super) fn pending_crates_count(&self) -> usize {

0 commit comments

Comments
 (0)