A batch run skips the nodes waiting on a failed one and ends error; a run whose nodes cannot load fails with the load error before anything executes; cancelling a run stops its pipeline without announcing a pause of the live flow; batch_issues refuses a delay node's interval; the client accepts an engine URL with or without /api/v1; RedisState's compare-and-swap records the names it writes
This commit is contained in:
@@ -147,6 +147,8 @@ class NodeOutcome(BaseModel):
|
||||
artifacts: dict[str, dict[str, Any]] = {}
|
||||
#: Restored from an earlier run rather than executed.
|
||||
cached: bool = False
|
||||
#: Not executed, because a node it waits on failed or was skipped itself.
|
||||
skipped: bool = False
|
||||
#: Which run the restored values came from — and, because a restored row
|
||||
#: holds no series of its own, which run this node's metrics live in.
|
||||
cached_from: str = ""
|
||||
@@ -1071,7 +1073,8 @@ class Pipeline:
|
||||
overrides: dict[str, Any] | None = None,
|
||||
inputs: dict[str, Any] | None = None,
|
||||
) -> dict[str, Any] | None:
|
||||
"""Run one node and record its outputs. Never raises.
|
||||
"""Run one node and record its outputs. Never raises: None means it
|
||||
failed, and a node that published nothing answers ``{}``.
|
||||
|
||||
``inputs`` is what the readiness check already read — the same keys, a
|
||||
moment earlier. Reading them again here was the second of two MGETs
|
||||
@@ -1106,7 +1109,7 @@ class Pipeline:
|
||||
if key:
|
||||
hit, restored = self._from_cache(node, key, state, entry_id)
|
||||
if hit:
|
||||
return restored
|
||||
return restored or {}
|
||||
|
||||
with logs.capture(collected):
|
||||
result = node.execute(inputs)
|
||||
@@ -1169,7 +1172,7 @@ class Pipeline:
|
||||
output_values=result,
|
||||
)
|
||||
)
|
||||
return result
|
||||
return result or {}
|
||||
except Exception as exc:
|
||||
# One failing node must not take the rest of the graph down.
|
||||
error = self.publish_error(node, exc, collected, entry_id)
|
||||
@@ -1431,6 +1434,11 @@ class Pipeline:
|
||||
|
||||
ready_nodes = deque(n for n, count in in_degree.items() if count == 0)
|
||||
blocked: set[Node] = set()
|
||||
# A batch run starts from an empty state, so a node whose producer
|
||||
# failed would be called without that input. It is skipped instead,
|
||||
# and so is everything waiting on it. A live wave still has the last
|
||||
# values to run on.
|
||||
failed: set[Node] | None = set() if self.run_id else None
|
||||
gate_revision = self._gate_revision
|
||||
node_futures: dict[Future[dict[str, Any] | None], Node] = {}
|
||||
finished: SimpleQueue[Future[dict[str, Any] | None]] = SimpleQueue()
|
||||
@@ -1469,6 +1477,11 @@ class Pipeline:
|
||||
if n.passive:
|
||||
complete(n)
|
||||
continue
|
||||
if failed is not None and not failed.isdisjoint(deps[n]):
|
||||
failed.add(n)
|
||||
self._observe(NodeOutcome(node=n.id, ok=False, skipped=True))
|
||||
complete(n)
|
||||
continue
|
||||
if fresh is not None and untouched(n):
|
||||
complete(n)
|
||||
continue
|
||||
@@ -1497,6 +1510,8 @@ class Pipeline:
|
||||
future = finished.get()
|
||||
n = node_futures.pop(future)
|
||||
result = future.result()
|
||||
if result is None and failed is not None:
|
||||
failed.add(n)
|
||||
if result is not None and fresh is not None:
|
||||
fresh.update(result)
|
||||
# Silent, failed and throttled producers still release their
|
||||
|
||||
Reference in New Issue
Block a user