feat: unified management stop event - #28
Conversation
Author
|
augment review |
🤖 Augment PR SummarySummary: This PR unifies workflow cancellation by introducing a shared Changes:
Technical Notes: Cancellation is now coordinated by a single event shared across orchestration and execution components, aiming for consistent shutdown behavior and faster teardown. 🤖 Was this summary useful? React with 👍 or 👎 |
| self._stop_event = stop_event | ||
| self._layers = layers if layers is not None else [] | ||
|
|
||
| def stop(self) -> None: |
There was a problem hiding this comment.
| self._thread = threading.Thread(target=self._dispatcher_loop, name="GraphDispatcher", daemon=True) | ||
| self._thread.start() | ||
|
|
||
| def stop(self) -> None: |
|
|
||
| def _should_stop(self) -> bool: | ||
| """Check if execution should be stopped.""" | ||
| return self.graph_runtime_state.stop_event and self.graph_runtime_state.stop_event.is_set() |
| node_type=self.node_type, | ||
| start_at=self._start_at, | ||
| node_run_result=NodeRunResult( | ||
| status=WorkflowNodeExecutionStatus.FAILED, |
| assert not answer_node._should_stop() | ||
|
|
||
| # Set the stop_event | ||
| runtime_state.stop_event.set() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR from qodo-benchmark#171