Return more details when acting on a paused/removed sandbox#2561
Return more details when acting on a paused/removed sandbox#2561djeebus wants to merge 5 commits into
Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit d33eb47. Bugbot is set up for automated code reviews on this repo. Configure here. |
❌ 96 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 88 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
| if markErr := o.sandboxStore.MarkKilled(ctx, teamID, sandboxID, reason); markErr != nil { | ||
| logger.L().Warn(ctx, "Failed to mark sandbox as killed", | ||
| logger.WithSandboxID(sandboxID), | ||
| zap.Error(markErr), | ||
| ) | ||
| } |
There was a problem hiding this comment.
The error handling for MarkKilled is only logging a warning. If this operation fails, the API will continue to return 404 Not Found instead of 410 Gone for a killed sandbox, which contradicts the intent of this change. Consider if this failure should be treated as a critical error or if the system should retry.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d33eb47. Configure here.
|
|
||
| if currentState != newState && !sandbox.AllowedTransitions[currentState][newState] { | ||
| return false, nil, &sandbox.InvalidStateTransitionError{CurrentState: currentState, TargetState: newState} | ||
| return false, nil, &sandbox.InvalidStateTransitionError{CurrentState: currentState, TargetState: newState, Transition: sbx._data.Transition} |
There was a problem hiding this comment.
Data race accessing Transition field after mutex unlock
Medium Severity
After sbx.mu.Unlock() at line 180, sbx._data.Transition is read without holding the lock at line 183. The currentState variable is safely captured before the unlock, but the newly added Transition field access is unprotected. Another goroutine (the callback at lines 232-261) can concurrently acquire the lock and modify sbx._data.Transition, causing a data race.
Reviewed by Cursor Bugbot for commit d33eb47. Configure here.


No description provided.