Skip to content

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

Open
vdusek wants to merge 1 commit into
masterfrom
feat/abort-child-runs-with-parent
Open

vdusek wants to merge 1 commit into
masterfrom
feat/abort-child-runs-with-parent

Conversation

@vdusek

@vdusek vdusek commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds abort_with_parent to Actor.start, Actor.call, Actor.start_task and Actor.call_task. It's off by default and needs run_name. The flag is stored as abortWithParent in the name's record under __ACTOR_CHILD_RUNS, 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.

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.29%. Comparing base (d382995) to head (c1f6b59).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1153      +/-   ##
==========================================
+ Coverage   93.20%   93.29%   +0.09%     
==========================================
  Files          54       54              
  Lines        3721     3776      +55     
==========================================
+ Hits         3468     3523      +55     
  Misses        253      253              
Flag Coverage Δ
e2e 32.78% <22.80%> (-0.17%) ⬇️
integration 52.33% <28.07%> (-0.38%) ⬇️
unit 90.12% <100.00%> (+0.14%) ⬆️

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
@vdusek
vdusek force-pushed the feat/abort-child-runs-with-parent branch from 9554a97 to 1782ca6 Compare October 6, 2026 13:20
Base automatically changed from feat/child-runs-api to master October 9, 2026 14:50
@vdusek
vdusek force-pushed the feat/abort-child-runs-with-parent branch from 2d70b86 to c1f6b59 Compare October 9, 2026 15:11
@vdusek
vdusek requested review from Mantisus and Pijukatel October 9, 2026 15:19
@vdusek
vdusek marked this pull request as ready for review October 9, 2026 15:19
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 9, 2026

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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Abort child runs when the parent is gracefully aborted

2 participants