fix(cli): retry transient mounted-drive reads (ENG-4049) - #353
fix(cli): retry transient mounted-drive reads (ENG-4049)#353SystemSculpt wants to merge 3 commits into
Conversation
🧪 Testing GuideWhat this PR addressesThe Steps to reproduce the original issue
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
There was a problem hiding this comment.
LGTM
Well-scoped, defensive retry for a single idempotent read path. The classification logic (isRetryableWorkloadUnavailable) is strict—requiring 404 status, correct code, retryable: true, and platform provenance. The retry loop correctly closes every response body, caps delay to remaining budget, and respects context cancellation. The test suite is thorough and the backoff arithmetic checks out. No correctness, security, or concurrency issues found.
Tag @mendral-app with feedback or questions. View session
|
Parking this for now — not abandoned. State: the fix is correct and targets a real, currently-active group. Why it is parked:
To resume: merge #352, let GitHub retarget this to Related: ENG-4049, with the platform contract follow-up in ENG-4071. |
Problem
bl drive mounts performs an idempotent GET directly against a sandbox. During standby/resume or gateway placement, the gateway can return its typed 404 WORKLOAD_UNAVAILABLE response before any workload dispatch. The CLI immediately failed that read, creating a poor first-call experience and repeated Sentry reports even though a short wait often succeeds.
Tracked in ENG-4049. The platform contract/root follow-up is ENG-4071, related to ENG-2972.
Root cause
The CLI treated every sandbox 404 alike. It did not distinguish:
Without that contract, a safe read could not recover without risking broad retries of mutations.
Fix
Verification
Scope
This is intentionally a narrow customer-path recovery for one idempotent read, not a general retry framework and not a substitute for the gateway contract fix. Mount, unmount, create, delete, and every other mutation remain single-attempt.
Depends on #352, which supplies the explicit telemetry classification boundary.
Linear: ENG-4049, ENG-4071
Note
Adds a retry mechanism for the idempotent GET used by
bl drive mounts. Only retries on a precisely-identified platform-ownedWORKLOAD_UNAVAILABLE404 with exponential backoff (500ms initial, 30s max, 60s budget). Includes a comprehensive test suite covering success-after-retry, budget exhaustion, cancellation, transport errors, body closing, and rejection of non-retryable/untrusted error shapes.Written by Mendral for commit e1a0716.