Skip to content

feat: reattach named child runs after migration or resurrection - #1149

Draft
vdusek wants to merge 7 commits into
masterfrom
feat/named-child-runs
Draft

vdusek wants to merge 7 commits into
masterfrom
feat/named-child-runs

Conversation

@vdusek

@vdusek vdusek commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Actor.start and Actor.call accept an optional name. The SDK writes the name and run ID to the default key-value store (APIFY_CHILD_RUNS) right after the child starts. After a migration or resurrection of the parent, the same call finds the recorded run and reuses it:

  • READY / RUNNING: reattaches to it
  • SUCCEEDED: returns it as is
  • ABORTED / TIMED-OUT: resurrects it (an ABORTING / TIMING-OUT run is waited for first)
  • FAILED, or the run no longer exists: starts a new run and keeps the old ID in previousRunIds

A named call on a reattached or resurrected run streams only new log lines. Reusing a name for a different Actor raises ValueError, and concurrent calls under one name in the same process share a single run.

A hard kill between the platform starting the child and the registry write can still orphan the child. Closing that gap needs an idempotency key on the run-start endpoint.

Closes #1127

✍️ Drafted by Claude Code

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

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.09%. Comparing base (34a12d5) to head (82366a3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1149      +/-   ##
==========================================
+ Coverage   92.89%   93.09%   +0.20%     
==========================================
  Files          53       54       +1     
  Lines        3560     3651      +91     
==========================================
+ Hits         3307     3399      +92     
+ Misses        253      252       -1     
Flag Coverage Δ
e2e 32.81% <40.42%> (+0.20%) ⬆️
integration 52.75% <40.42%> (-0.29%) ⬇️
unit 89.78% <100.00%> (+0.26%) ⬆️

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 07:49

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.

Named child runs that survive migration and resurrection

2 participants