Skip to content

fix(api): race conditions in eviction#2100

Open
jakubno wants to merge 7 commits intomainfrom
fix/prevent-race-in-eviction
Open

fix(api): race conditions in eviction#2100
jakubno wants to merge 7 commits intomainfrom
fix/prevent-race-in-eviction

Conversation

@jakubno
Copy link
Member

@jakubno jakubno commented Mar 11, 2026

Note

Medium Risk
Changes eviction/removal behavior and sandbox state-transition coordination in both memory and Redis stores, which could impact lifecycle operations under concurrency. Risk is mitigated by explicit eviction gating and updated tests, but regressions could affect auto-pause/kill and cleanup paths.

Overview
This PR hardens sandbox eviction/removal to avoid races with in-flight state transitions and TTL extensions by introducing sandbox.RemoveOpts (including an Eviction flag) and enforcing under-lock expiry/transition checks before evicting. It also standardizes sandbox-not-found handling via sandbox.ErrNotFound, updates orchestrator/handlers to use the new removal API, and makes the evictor treat ErrNotEvictable/ErrNotFound as expected outcomes rather than noisy failures.

Written by Cursor Bugbot for commit 986f409. This will update automatically on new commits. Configure here.

@jakubno jakubno marked this pull request as ready for review March 11, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants