fix(modal): reuse env secrets across sandbox operations#1805
Closed
EazyReal wants to merge 1 commit into
Closed
Conversation
|
@EazyReal is attempting to deploy a commit to the Harbor Framework Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Enjoy a better diff viewing experience by clicking one of these URLs: |
Contributor
Author
|
Superseded by #1806 so the source branch can use |
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.
Problem
The Modal environment injects persistent task env and per-exec env through
Secret.from_dict. Under high concurrency, identical env payloads can produce one ephemeral Modal Secret per sandbox startup and per exec. Modal applies workspace-wide secret create limits, so a startup or setup burst can fail with transient infrastructure errors even though the env payload is unchanged.Approach
Secret.from_dictobjects by an order-independent env payload key._secrets_config) and per-command execution (_sdk_exec).Validation
uv run pytest tests/unit/environments/test_modal.py -q->28 passeduv run ruff check --fix .->All checks passed!uv run ruff format .->1004 files left unchangeduv run ty check->All checks passed!uv run pytest tests/unit -q->2723 passed, 1 skipped