Skip to content

fix(api): keep allocations unchanged on NotFound - #3677

Open
perfloop-agent wants to merge 1 commit into
e2b-dev:mainfrom
perfloop-oss:perfloop-pr-open-fkp1qea3px
Open

perfloop-agent wants to merge 1 commit into
e2b-dev:mainfrom
perfloop-oss:perfloop-pr-open-fkp1qea3px

Conversation

@perfloop-agent

@perfloop-agent perfloop-agent commented Oct 11, 2026 •

Copy link
Copy Markdown

killSandboxOnNode subtracts a sandbox's resources when Delete returns NotFound. If a newer node report already removed the sandbox from the totals, this subtracts it twice.

Return on NotFound before updating the counters. The test fails on the old code and passes with this change. It also covers successful deletes and other errors.

Allocations can remain over-counted until the next node report, normally every 20 seconds. Successful deletes can still race with node reports.

Full API tests, including ARM64 execution, still need upstream CI.

Found by Perfloop.

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Tomás Senart <ts@perfloop.ai>

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