perf(sdks): release idle sandboxes with bounded concurrency - #1475
Pangjiping merged 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6e424830f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Suggestion: keep the existing
|
|
Addressed in 992100d. The legacy methods are restored unchanged, and bounded parallel cleanup is now opt-in:
For Kotlin, the concurrency argument is intentionally explicit: a defaulted overload next to the preserved no-arg overload would be unreachable for no-arg calls, which must continue selecting the legacy serial method. I also reran the same pre-production benchmark with 100 idle sandboxes and concurrency 50. The legacy serial Python path took 11.422s; the new parallel path took 0.749s (~15.25x faster). Both runs ended with store idle=0, remote remaining=0, and the test pools destroyed. |
Summary
Closes #1472.
Testing
Automated checks:
cd sdks/sandbox/go && go test ./...cd sdks/sandbox/python && uv run ruff check src/opensandbox/pool_async.py src/opensandbox/sync/pool.py tests/test_pool_async.py tests/test_pool_sync.pycd sdks/sandbox/python && uv run pyright src/opensandbox/pool_async.py src/opensandbox/sync/pool.pycd sdks/sandbox/python && uv run pytest tests/test_pool_async.py tests/test_pool_sync.py -qcd sdks/sandbox/kotlin && ./gradlew spotlessCheck :sandbox:test --tests '*releaseAllIdle*'release_all_idle()c3e97bfb)a6e42483)The release path was approximately 10.8x faster (90.7% lower elapsed time).
Breaking Changes
Checklist