feat(apply): add --concurrency limit for deploy/destroy#504
Open
sam-goodwin wants to merge 1 commit into
Open
Conversation
Bound how many resources run a provider lifecycle operation at once.
Defaults to unbounded; defers to Effect's concurrency model via a shared
semaphore that gates only the actual provider call, never the dependency
wait, so a tight limit can never deadlock the DAG.
- `apply(plan, { concurrency })` accepts `"unbounded" | number` (default
`"unbounded"`). The limit is enforced at `instrumentLifecycle`, the single
dispatch chokepoint, so it covers create/update/replace/precreate/delete
across executePlan, converge, and collectGarbage with one shared permit.
- `--concurrency <n>` flag on `deploy` and `destroy` (e.g. `--concurrency 64`).
- Test harness `deploy`/`destroy` accept `ApplyOptions` so the limit is
testable.
- apply.test.ts: unbounded runs all at once; a limit caps the high-water
mark; concurrency 1 serializes; a dependency chain doesn't deadlock under a
tight limit; destroy honors the limit.
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/a85fd1e@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/a85fd1e@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/a85fd1e |
Contributor
Website Preview DeployedURL: https://alchemyeffectwebsite-worker-pr-504-67p2sklcbinzz3cl.testing-2b2.workers.dev Built from commit This comment updates automatically with each push. |
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.
Cap how many resources apply at once. Defaults to unbounded.
Programmatic:
The limit is a shared semaphore taken only around the provider call, never around the dependency wait — so a resource blocked on its upstreams holds no permit and a tight limit (even
--concurrency 1) can't deadlock the DAG.