Skip to content

feat: abort named child runs when the parent is gracefully aborted - #1153

Draft
vdusek wants to merge 9 commits into
feat/child-runs-apifrom
feat/abort-child-runs-with-parent
Draft

vdusek wants to merge 9 commits into
feat/child-runs-apifrom
feat/abort-child-runs-with-parent

Conversation

@vdusek

@vdusek vdusek commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1151.

Adds abort_with_parent to Actor.start and Actor.call. It's off by default and needs name. The flag is stored with the name in the child run registry, so a parent that migrated or was resurrected still knows which children to abort. The latest call under a name sets the value.

The SDK registers its own ABORTING listener on ApifyEventManager when the Actor context starts. It's kept apart from user listeners, so off() without a listener doesn't remove it. On a graceful abort, it gracefully aborts every flagged child that's still READY or RUNNING, all in parallel. If one abort fails, the error is logged and the others go ahead. Each child is aborted with the client it was started with in this process, which matters when a custom token was passed. A child from before a migration uses the default client. ChildRunInfo now exposes the flag too.

A hard abort, a timeout or an OOM kill still leaves the children running. Covering that needs a parent/child link on the platform.

Closes #1128

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 30, 2026
@vdusek vdusek self-assigned this Sep 30, 2026
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.21%. Comparing base (08fe7c0) to head (9554a97).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           feat/child-runs-api    #1153      +/-   ##
=======================================================
+ Coverage                93.13%   93.21%   +0.07%     
=======================================================
  Files                       54       54              
  Lines                     3672     3728      +56     
=======================================================
+ Hits                      3420     3475      +55     
- Misses                     252      253       +1     
Flag Coverage Δ
e2e 33.02% <26.98%> (-0.07%) ⬇️
integration 52.60% <31.74%> (-0.32%) ⬇️
unit 89.99% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek added this pull request to stack #1152 September 30, 2026 08:19
@vdusek vdusek linked an issue Sep 30, 2026 that may be closed by this 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

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Abort child runs when the parent is gracefully aborted

2 participants