Skip to content

remote-worker: a container Release whose rename fails answers an error, not RELEASED (follow-up to #949) - #953

Merged
webchang merged 1 commit into
rossoctl:mainfrom
webchang:pr/i338-release-detach-error
Nov 20, 2026
Merged

webchang merged 1 commit into
rossoctl:mainfrom
webchang:pr/i338-release-detach-error

Conversation

@webchang

Copy link
Copy Markdown
Member

Summary

Follow-up to #949 (#338), from the review there: on the container tier, a Release whose workspace rename fails for any reason other than "not found" answered RELEASE_OUTCOME_RELEASED with the directory still in place. The wire contract says RELEASED means the workspace is freed, and a filesystem error is the error string a sender retries on; vmpool's Release already answers that failure that way, so the two tiers disagreed.

What changes

  • remote-worker/internal/exec/workspace.go: detachLocked keeps logging the rename's detail (the path and the OS error) and now returns a fixed, path-free error (workspace removal failed; the sweep retries) instead of "". The error goes back to the client and into the relay's audit, so it names no host path; it doesn't start with release_unsupported:, busy: or invalid-, so the relay answers it as a retryable failure.
    • Release answers RELEASE_OUTCOME_UNSPECIFIED plus that error. The key is refused all the same (it is marked released before the detach), and it stays tracked, so a later Release or the idle sweep finishes the job.
    • The release that runs when a busy Exec returns logs the error and leaves the key to the sweep, as vmpool does after an Exec.

Tests

TestReleaseWhoseDetachFailsAnswersAnErrorNotReleased makes the rename fail (Root not writable; skipped as root), and checks that Release answers (UNSPECIFIED, an error) whose message names no path, the workspace is still there, an Exec for the key is refused released:, and a second Release once the rename can succeed answers RELEASED and removes the directory.

before after
the new test, on main's workspace.go fails: Release with a failing rename = (RELEASE_OUTCOME_RELEASED, <nil>) passes
go vet ./..., go test ./... (remote-worker) pass
go test -race ./internal/exec passes

Part of #338

Assisted-By: Claude Code

…r, not RELEASED

Follow-up to rossoctl#949 (rossoctl#338): the container tier's detachLocked logged a rename that failed
for any reason other than ENOENT and returned "", so Release answered RELEASED with the
directory still there. The wire contract says RELEASED means the workspace is freed, and
a filesystem error is the error string a sender retries on; vmpool's Release already
answers that failure so. detachLocked now logs the detail (path and OS error, as before)
and returns a fixed, path-free error, since it travels to the client and the relay's
audit: Release answers UNSPECIFIED plus it (the key is refused all the same, and stays
tracked, so a later Release or the sweep finishes the job), and the release after a busy
Exec logs it, as vmpool does.

Assisted-By: Claude Code
Signed-off-by: Rong Chang <[email protected]>
@webchang
webchang requested a review from pdettori as a code owner November 20, 2026 13:36
@pdettori pdettori modified the milestones: v0.11.0, v0.11.1 Nov 20, 2026
@pdettori pdettori added ready-for-ai-review Request automated AI code review from clawgenti bug Something isn't working labels Nov 20, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — remote-worker: a container Release whose rename fails answers an error, not RELEASED (follow-up to #949)

The #949 nit, done better than it was asked: the failure now goes back as an error with outcome UNSPECIFIED, and the error itself is a fixed, path-free string, since it travels to the client and the relay's audit.

  • detachLocked returns (tomb, error): ENOENT is still "nothing to remove", any other rename failure logs the detail (the host path and OS text stay in that log) and returns errWorkspaceDetach, keeping the key tracked so the sweep retries — the same shape vmpool already had.
  • The string starts with none of release_unsupported:, busy:, invalid-workspace-key: or empty-workspace-key:, so the relay's releaseErrorStatus maps it to UNAVAILABLE: retryable, which is what the proto asks for a filesystem error.
  • The Exec-unwind path (a Release that met the Exec busy) now logs the failed detach too, rather than silently keeping the run.
  • The test is careful about the environment: it skips under root (which can rename in a read-only directory), asserts the message has no / or root path, that the workspace is still there, that an Exec is refused released: anyway, and that a later Release — once the rename can succeed — finishes the job. That is exactly the contract.

Checks 17/17 green. Author: webchang (MEMBER — maintainer). One commit, signed off.

@webchang
webchang merged commit d1493f0 into rossoctl:main Nov 20, 2026
17 checks passed
webchang added a commit to webchang/moca that referenced this pull request Nov 20, 2026
Keeps both tests in workspace_release_test.go: the startup sweep's and rossoctl#953's failed-rename Release.

Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 22, 2026
57 commits past Moca v0.11.0 (rossoctl#953-rossoctl#976), among them rossoctl#959 (the member
routes write audit lines), rossoctl#960 (gate-image.py, Moca's general gate),
rossoctl#976 (the vault credential store, inert with egress credentials off)
and the lease-mode vmpool changes. No conflict; the fork-only set is
unchanged.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 24, 2026
The sync paragraph named upstream 49cce28 (API 1.35.0, harness 1.7.0); the branch is now at upstream de6c9b5 (rossoctl#953-rossoctl#990: API 1.37.0, harness API 1.8.0), merged in 27df5df.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants