Skip to content

fix(orch): count in-flight starts toward sandbox limit - #3667

Open
juliangoetze wants to merge 2 commits into
e2b-dev:mainfrom
juliangoetze:fix/orchestrator-sandbox-admission-limit
Open

juliangoetze wants to merge 2 commits into
e2b-dev:mainfrom
juliangoetze:fix/orchestrator-sandbox-admission-limit

Conversation

@juliangoetze

Copy link
Copy Markdown

Problem

The per-node sandbox limit was checked after reserving the sandbox ID, using only the live sandbox count. Starts that were still in flight were not included. A burst of concurrent creates could therefore all observe available capacity and start more sandboxes than the configured node limit.

Changes

  • check the node limit while reserving the sandbox ID under the sandbox registry lock
  • count in-flight starts, live sandboxes, failed-start cleanup holds, and checkpoint holds toward the same limit
  • keep duplicate-ID detection ahead of the capacity error
  • add map-level concurrency coverage and a server regression test for plain and snapshot creates

Testing

  • go vet ./pkg/sandbox/ ./pkg/server/
  • go test -race -count=1 ./pkg/sandbox/ ./pkg/server/
  • targeted admission and capacity tests repeated 10 times under the race detector
  • golangci-lint 2.13.2
  • gofmt and git diff --check

The Go checks were run in the repository-pinned Go 1.26.8 Linux environment.

- reserve sandbox capacity atomically with the sandbox ID
- count live sandboxes, in-flight starts, and checkpoint holds once
- cover concurrent admission and server-level capacity regressions
@cla-bot

cla-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @juliangoetze on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check'

@juliangoetze

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Sep 28, 2026
@cla-bot

cla-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@juliangoetze

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant