Skip to content

feat: retry starting a run on memory and concurrent-runs limits - #1081

Draft
vdusek wants to merge 4 commits into
masterfrom
feat/wait-for-resources
Draft

vdusek wants to merge 4 commits into
masterfrom
feat/wait-for-resources

Conversation

@vdusek

@vdusek vdusek commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds a wait_for_resources argument to ActorClient.start/call and TaskClient.start/call, sync and async. When set, a start that the API rejects with actor-memory-limit-exceeded or concurrent-runs-limit-exceeded is retried every 10 seconds. Orchestrators no longer need their own wait-and-retry loop.

  • True retries until the run starts. A timedelta limits the retrying, after which the last 402 error is raised.
  • Any other error is raised right away.
  • In call, the retry time doesn't count toward wait_duration.
  • A file-like input is read into memory before the first attempt, so every retry sends it whole.
  • A run that asks for more memory than the account's whole memory limit gets the same actor-memory-limit-exceeded error and never starts, so True retries it forever. The API has no separate error type for that case. The docs call it out.

The Retries concept page gets a section with sync and async examples. The JS twin is apify/apify-client-js#1091 and uses the same design.

Closes #1071

✍️ 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 95.27%. Comparing base (4dcc54c) to head (8271dd3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1081      +/-   ##
==========================================
+ Coverage   95.24%   95.27%   +0.03%     
==========================================
  Files          59       60       +1     
  Lines        5548     5591      +43     
==========================================
+ Hits         5284     5327      +43     
  Misses        264      264              
Flag Coverage Δ
integration 91.80% <53.19%> (-0.25%) ⬇️
unit 87.78% <100.00%> (+0.38%) ⬆️

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 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.

Retry starting a run on memory and concurrent-runs limits

2 participants