Skip to content

Support PhaseSequence, PhaseGroup, and nested PhaseGraph as PhaseGraph nodes. - #1344

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_999072646
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_999072646

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Support PhaseSequence, PhaseGroup, and nested PhaseGraph as PhaseGraph nodes.

Lets a PhaseGraph express independent lanes, e.g. two PhaseSequences that run concurrently after a fork, or a PhaseGroup lane whose teardown is guaranteed even when a sibling lane fails.

  • Widen PhaseGraph nodes from PhaseDescriptor to any PhaseNode. Collection nodes must be named (UnnamedNodeError) because edges are keyed by node name.
  • Dispatch graph nodes through _execute_node() so sequences, groups, and nested graphs run with their usual semantics on the worker thread.
  • Scope cancellation to the graph: when a node is terminal (outside teardown) the graph's cancellation event is set, unstarted nodes are cancelled, and running phases are killed, but the stop state is reset immediately so PhaseGroup nodes still unwinding on worker threads run their teardown phases. _execute_abortable_sequence() and _execute_phase() consult the per-thread cancellation scopes (alongside the test abort flag) so cancelled lanes do not start further non-teardown phases.
  • Replace the teardown RLock with a counter-based _TeardownGuard so teardown sequences may run concurrently on worker threads (an RLock held by the scheduling thread would deadlock a PhaseGroup node's teardown inside a teardown graph); aborts still never cancel in-progress teardown phases.
  • Add unit tests for collection nodes in the data model (naming, copies, nesting, transforms, filter_by_type) and in the executor (fork/join with sequence and group lanes, nested graphs, group teardown surviving sibling failure and abort, a sequence lane stopping after sibling failure, and a group node inside a teardown graph).

FUTURE_COPYBARA_INTEGRATE_REVIEW=#1340 from google:glados-verma-contrib 45bf71e

…h nodes.

Lets a PhaseGraph express independent lanes, e.g. two PhaseSequences that run concurrently after a fork, or a PhaseGroup lane whose teardown is guaranteed even when a sibling lane fails.

- Widen PhaseGraph nodes from PhaseDescriptor to any PhaseNode. Collection nodes must be named (UnnamedNodeError) because edges are keyed by node name.
- Dispatch graph nodes through _execute_node() so sequences, groups, and nested graphs run with their usual semantics on the worker thread.
- Scope cancellation to the graph: when a node is terminal (outside teardown) the graph's cancellation event is set, unstarted nodes are cancelled, and running phases are killed, but the stop state is reset immediately so PhaseGroup nodes still unwinding on worker threads run their teardown phases. _execute_abortable_sequence() and _execute_phase() consult the per-thread cancellation scopes (alongside the test abort flag) so cancelled lanes do not start further non-teardown phases.
- Replace the teardown RLock with a counter-based _TeardownGuard so teardown sequences may run concurrently on worker threads (an RLock held by the scheduling thread would deadlock a PhaseGroup node's teardown inside a teardown graph); aborts still never cancel in-progress teardown phases.
- Add unit tests for collection nodes in the data model (naming, copies, nesting, transforms, filter_by_type) and in the executor (fork/join with sequence and group lanes, nested graphs, group teardown surviving sibling failure and abort, a sequence lane stopping after sibling failure, and a group node inside a teardown graph).

FUTURE_COPYBARA_INTEGRATE_REVIEW=#1340 from google:glados-verma-contrib 45bf71e
PiperOrigin-RevId: 999072646
@google-cla

google-cla Bot commented Oct 14, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants