Deleting a live flow ends the calls it has out on workers and drops what a removed node still returns, so a node that never returns gives its slot and process back and a late answer no longer recreates the flow's values; a cancel goes through the call's own inbox and is sent after the call's frame, so a service stopped right after starting no longer cancels before its serve
This commit is contained in:
@@ -264,15 +264,16 @@ class Node:
|
||||
if self._on_health is not None:
|
||||
self._on_health(self, status, detail)
|
||||
|
||||
def bind(self, pipeline: Pipeline) -> None:
|
||||
def bind(self, pipeline: Pipeline | None) -> None:
|
||||
"""
|
||||
Bind this node to a pipeline for external triggering.
|
||||
|
||||
Once bound, the node can trigger downstream execution when called.
|
||||
This is typically done automatically during pipeline construction.
|
||||
|
||||
:param pipeline: The pipeline to bind this node to.
|
||||
:type pipeline: Pipeline
|
||||
:param pipeline: The pipeline to bind this node to, or None once its
|
||||
flow has been taken out of the graph.
|
||||
:type pipeline: Pipeline | None
|
||||
"""
|
||||
self._pipeline = pipeline
|
||||
|
||||
@@ -466,6 +467,9 @@ class Node:
|
||||
collected = logs.Collector()
|
||||
with logs.capture(collected):
|
||||
outputs = self.f(params=self.params) or {}
|
||||
if self._pipeline is None:
|
||||
# Its flow was deleted while it ran (`Pipeline.remove_flow`).
|
||||
return None
|
||||
self._pipeline.publish_log(self, collected, "")
|
||||
|
||||
return self._pipeline.trigger(self, self._to_messages(outputs), durable=durable)
|
||||
|
||||
Reference in New Issue
Block a user