Repository navigation
feat: child run starts that wait for capacity on the account, as apify-orchestrator does - #32
Merged
Merged
Conversation
…y-orchestrator does `CallOptions::wait_for_capacity`: the platform refuses a start when the account lacks memory or Actor jobs. With the option, such starts go one at a time, a refused one is tried again every second once a 10-second cooldown has passed (during which none goes), and once this run is aborting, migrating or exiting they fail instead of starting. With `run_name`, the run is tracked and reused as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S
- The in-process re-open of a deleted alias went through `Services`, which hands back the instance it already opened (as `StorageInstanceManager` does in JS), so the backend never resolved it again. Ask the backend. - The replaced declared storage is remembered on the platform, so the off-platform check now asserts the mapping is unchanged instead of absent. - The deleted default dataset is no longer the storage expected to exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S (cherry picked from commit 519338e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Actor::callandActor::startalready cover most of what Actors useapify-orchestratorfor: named runs (run_name) that are reused across retries, migrations and resurrections, the tracked runs persisted, and runs aborted with the parent. One part was missing: waiting for capacity. The platform refuses a start when the account lacks memory (actor-memory-limit-exceeded) or Actor jobs (concurrent-runs-limit-exceeded), and the orchestrator queues such starts instead of failing.CallOptions::wait_for_capacitydoes the same:A task called without
run_namebut with the option goes through the start path, so its start can wait.This lets instagram-rs delete
src/utils/initialize_orchestrator.rs(about 550 lines), and the standalone export Actor delete its copy (orchestrator.rs). They would callActor::call(actor, input, CallOptions { token, run_name, wait_for_capacity: true, abort_with_parent: true, .. })instead. One difference: the orchestrator keeps its runs AES-encrypted underORCHESTRATOR-CLIENT-RUNS, and the SDK keeps them under__ACTOR_CHILD_RUNS. A run that migrates across the switch would not find the runs it tracked before.Tested with unit tests on paused time (
child_runs::tests). The two redtests/storage.rstests are the ones from #28 that also fail on master (see #29).Generated by Claude Code