mojo: Ensure promise chain handles each item promise by trapping errors.

Authored by mpyne on Sep 21 2018, 4:43 AM.

Description

mojo: Ensure promise chain handles each item promise by trapping errors.

Promise chains could keep dependent jobs from starting if a dependency
failed. This is, of course, the whole point. But the current state is
overly restrictive.

  1. Ordering-only (queue-based) dependencies are not real dependencies

but are only there to keep multiple jobs from running in a given queue
at once. If a job fails in that queue the remaining jobs can still
proceed.

Fixed by tracking them separately and inserting a catch statement so
that any promises waiting on this for ordering still continue as normal.

  1. Real dependencies would refuse to run at all, but this meant that a

deadlock would happen since the promise-resolving code wouldn't run at
all either (if the 'base promise' had rejected, the ->then never runs)

Fixed by introducing a catch statement that traps the error and then
manually rejects the failed item's promise. Though it would be
interesting to instead try adjusting each item promise to "bake in" its
dependent promises to avoid the second step and allow rejection to
properly propagate.

Details

Committed
mpyneSep 21 2018, 4:50 AM
Parents
R365:9a23149f79d3: mojo: Simplify update code and fix deadlock with update failure.
Branches
Unknown
Tags
Unknown