Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: crash child task runs when parent flow run crashes#19600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
zzstoatzz wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromfix/crash-child-task-runs-19594

Conversation

@zzstoatzz
Copy link
Collaborator

@zzstoatzzzzstoatzz commentedDec 2, 2025
edited
Loading

Summary

When a flow run transitions to CRASHED state (e.g., OOM killed in Kubernetes), automatically transition all non-terminal child task runs to CRASHED as well.

  • AddsCrashChildTaskRuns transform toGlobalFlowPolicy
  • Follows the same pattern asUpdateSubflowParentTask
  • Ensures task runs don't remain stuck in RUNNING state when their parent flow crashes

Scope and behavior

What this handles

Nested tasks (tasks calling tasks): All tasks within a flow share the sameflow_run_id regardless of nesting depth. Whentask_a callstask_b callstask_c, they all have the sameflow_run_id. The fix correctly crashes all of them when the parent flow crashes.

All non-terminal task states: PENDING, RUNNING, SCHEDULED, PAUSED - any task that hasn't reached a terminal state will be transitioned to CRASHED.

Terminal tasks preserved: Tasks that have already COMPLETED, FAILED, CANCELLED, or CRASHED are not modified.

What this does NOT handle (separate concern)

Subflows: When a flow calls another flow as a subflow, that subflow is a separate flow run with its ownflow_run_id. The subflow's "parent task run" (in the parent flow) WILL be crashed by this fix, but the subflow itself won't be automatically cascaded to CRASHED. This is arguably a separate feature request, as subflows are architecturally independent flow runs that can be retried independently.

Test plan

  • Unit tests intests/server/orchestration/test_global_policy.py:
    • test_crash_child_task_runs_when_flow_crashes
    • test_does_not_crash_already_terminal_task_runs
    • test_does_not_crash_tasks_for_non_crashed_transitions
  • Integration tests inintegration-tests/test_crash_child_task_runs.py:
    • test_child_task_runs_crash_when_flow_crashes
    • test_does_not_crash_already_completed_tasks
    • test_crash_propagates_to_pending_tasks
  • Manual testing with Kubernetes work pool to verify OOM crash scenario

Fixes#19594

🤖 Generated withClaude Code

When a flow run transitions to CRASHED state (e.g., OOM killed inKubernetes), automatically transition all non-terminal child task runsto CRASHED as well. This ensures task runs don't remain stuck inRUNNING state when their parent flow crashes.Adds `CrashChildTaskRuns` transform to `GlobalFlowPolicy`, followingthe same pattern as `UpdateSubflowParentTask`.Fixes#19594🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
@github-actionsgithub-actionsbot added the bugSomething isn't working labelDec 2, 2025
@codspeed-hq
Copy link

codspeed-hqbot commentedDec 2, 2025
edited
Loading

CodSpeed Performance Report

Merging#19600 willnot alter performance

Comparingfix/crash-child-task-runs-19594 (cc2238d) withmain (dd875ab)

Summary

✅ 2 untouched

- Add proper docstrings explaining why API-level testing is appropriate- Add test for preserving already-completed tasks- Add test for crashing pending tasks- Clean up test structure and imports🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cicdwcicdwAwaiting requested review from cicdwcicdw will be requested when the pull request is marked ready for reviewcicdw is a code owner

@desertaxledesertaxleAwaiting requested review from desertaxledesertaxle will be requested when the pull request is marked ready for reviewdesertaxle is a code owner

@chrisguidrychrisguidryAwaiting requested review from chrisguidrychrisguidry will be requested when the pull request is marked ready for reviewchrisguidry is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

bugSomething isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Tasks stuck in Running state while flow is in Crashed state while using Kubernetes

2 participants

@zzstoatzz

[8]ページ先頭

©2009-2025 Movatter.jp