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>
@tsenart

tsenart commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Hi, I'm Tomás, I build Perfloop. I approved this contribution and will handle review feedback here.

We've had performance PRs merged in ClickHouse, Prometheus, Ruff/ty, parquet-go, RoaringBitmap, and more, including an earlier orchestrator fix here that you merged. This one keeps allocations unchanged when the API returns NotFound. Happy to reshape anything to fit how you'd like it.

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.

2 participants