fix(cubemaster): recover stranded pause snapshots - #1370
Conversation
Review: fix(cubemaster): treat existing pause snapshot as idempotent already-paused (PR #1370)AI-generated review — no human approval claimed. OverviewThis PR fixes a stranded-sandbox bug: when a pause RPC times out on the caller (CLM) but actually completes on Master/Cubelet, a pause-snapshot binding is left behind. The next auto-pause hit The fix is split into three coordinated parts:
I traced the end-to-end mechanism: Findings1. [Medium — residual risk] The fix's success path depends on a single, non-retried live probe; a transient probe failure re-triggers the exact 504 symptom
Anchored at 2. [Low — consistency] FAILED-timeout convergence is not healed to READY, unlike the CREATING pathThe CREATING branch heals the stranded binding via Anchored at 3. [Note] Cross-language marker contract is fragile but well-guardedThe 4. [Note — pre-existing] Probe target is
|
4867f61 to
7cdd78f
Compare
7cdd78f to
738e53a
Compare
738e53a to
0e4539c
Compare
0e4539c to
3cbfe32
Compare
3cbfe32 to
d31a2ff
Compare
d31a2ff to
9fbaf42
Compare
…paused When a pause RPC times out or Master exits after Cubelet completes the pause, a READY, FAILED-timeout, or CREATING snapshot binding can remain. A retry previously returned MasterParamsError, causing CLM to roll the proxy back to running while the backend stayed paused and later return HTTP 504. Confirm the live Cubelet state before treating a leftover binding as already paused, retry a transient probe failure once, and heal stale CREATING or timeout-FAILED bindings to READY. Preserve hard errors for running or inconclusive probes and explicit failures, and use a stable marker so CubeAPI maps only this idempotent case to success. Assisted-by: Claude Code:claude-opus-4.7 Signed-off-by: Like Xu <likexu@tencent.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9fbaf42 to
04631c1
Compare
|
Pause/resume is getting a major overhaul. Let's wait for it to merge, then rebase + retest |
This implies that the Cubelet should be idempotent for pause opertion. |
Problem
A pause can complete on Cubelet while its caller times out, or Master can exit before recording the result. The leftover READY, timeout-FAILED, or CREATING binding makes the next auto-pause return generic 130400. CLM then rolls CubeProxy back to
runningalthough the backend is PAUSED, so the next request bypasses auto-resume and ends in HTTP 504.Fix
cubelet.Listcall.[cube:already-paused]only on this idempotent branch; CubeAPI requires both 130490 and this marker before mapping redundant pause to HTTP success.Tests
Completebefore returning the marker.go test -short -count=20 -run TestPauseSandbox\\|TestShouldTreatAsAlreadyPaused\\|TestRecoverTimedOutPauseForResume ./pkg/service/sandboxgo test -short ./pkg/pausesnapAssisted-by: Claude Code:claude-opus-4.7
Signed-off-by: Like Xu likexu@tencent.com