orchestrator: include current/max counts in ResourceExhausted error messages - #3584
Open
AdaAibaby wants to merge 1 commit into
Open
orchestrator: include current/max counts in ResourceExhausted error messages#3584AdaAibaby wants to merge 1 commit into
AdaAibaby wants to merge 1 commit into
Conversation
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
August 18, 2026 02:34
All three ResourceExhausted returns in the orchestrator server were either missing the current count entirely or only reporting the max limit. This made the "Node exhausted, trying another node" log line on the API side carry no actionable information about how exhausted the node actually was. Add Current() and Limit() accessors to AdjustableSemaphore, then use them to format all three error messages as current=N, max=M. Fixes e2b-dev#3583
AdaAibaby
force-pushed
the
fix/orchestrator-resource-exhausted-error-context
branch
from
August 18, 2026 03:17
999c1f7 to
8de62ee
Compare
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.
Fixes #3583
Problem
When the orchestrator returns a
ResourceExhaustedgRPC error and the API logs "Node exhausted, trying another node", the attached error string carries no count information. All threeResourceExhaustedsites were either missing the current value or missing both current and max:Changes
packages/shared/pkg/utils/resizable_semaphore.go: AddCurrent() int64andLimit() int64accessors toAdjustableSemaphorepackages/orchestrator/pkg/server/sandboxes.go: Includecurrent=N, max=Min both running-sandboxes and starting-sandboxes error messagespackages/orchestrator/pkg/server/utils.go: Includecurrent=N, max=Min the resuming-sandboxes error messageAfter this change
This makes the "Node exhausted, trying another node" log line actionable — operators can now tell at a glance whether the node is fully saturated or just throttled on in-flight starts.
Test plan
go build ./packages/shared/...passesgo vet ./packages/shared/pkg/utils/...passesMaxSandboxesPerNodelimit and confirm the log line now includes current/max counts