Repository navigation
remote-worker: the startup sweep keeps a plain file named as a key, as the janitor does (follow-up to #954) - #979
Conversation
…the janitor does newestWorkspaceMtime judged a plain file by its own mtime, so an old file whose name checkKey accepts was detached and removed at startup. The host janitor leaves every non-directory alone, and no workspace is ever a plain file: the sweep now keeps it. A symlink named as a key is still removed as the link, as documented. Follow-up to rossoctl#954's review note. Signed-off-by: Rong Chang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]>
clawgenti
left a comment
There was a problem hiding this comment.
Summary
The change is right and the new test pins it. newestWorkspaceMtime now returns ok=false for a non-symlink, non-directory entry, and the only caller (startupSweep, startup_sweep.go:62) already treats !ok as "keep", so a plain file is left alone however old. I checked the janitor parity the PR claims: deploy/sbx/janitor.sh's sweep_root skips [[ -L "$path" || ! -d "$path" ]] with "not a directory (symlink or file); left alone", so the two now agree on plain files (the symlink case remains the documented #954 divergence).
Verified at 848db1f:
go test ./internal/vmpool/ -run TestStartupSweep— 6/6 pass, the newTestStartupSweepKeepsAnOldPlainFileNamedAsAKeyamong them.- Mutation check: with
startup_sweep.goreverted tomain's version (the new test kept), it fails —an old plain file named as a key was removed: ... no such file or directory— and passes with the change, as the body says. go vet ./internal/vmpool/...clean. The onego test ./internal/vmpoolfailure here,TestRestoreFoldsCloudHypervisorsOwnLogIntoTimeoutError, fails identically onmainin this sandbox (fork/exec .../fake-virtiofsd.py: permission denied); unrelated to this PR.
No findings.
Author: webchang (MEMBER — maintainer)
Areas reviewed: Go (remote-worker/internal/vmpool sweep and its test)
Agent/IDE config (.claude/.vscode): none
Commits: 1, all signed off: yes
CI status: passing (k8s-kind-e2e, lint, microvm-gates, proto, shellcheck, trivy-scan)
All checks pass. Ready for human review.
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Review — startup sweep keeps plain files
Approving. newestWorkspaceMtime now returns ok=false for a plain file, and the sweep's if !ok || now.Sub(newest) < idle { continue } keeps it unconditionally — the same posture as the host janitor, which leaves every non-directory alone. The symlink branch still runs first, so an old symlink named as a key is judged by the link's own mtime and removed as the link, never followed.
Verified the test is real: New() calls startupSweep() synchronously, so on main the old plain file is detached before the assertion; the new test fails there and passes with the change. CI 17/17; DCO signed; MEMBER author; no .claude//.vscode/ changes; no injection content.
Upstream rossoctl#972, rossoctl#977, rossoctl#978, rossoctl#979, rossoctl#981, rossoctl#983, rossoctl#985, rossoctl#988 and rossoctl#990 (44 commits past 49cce28). No conflict. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
Follow-up to #954's review note (the startup sweep, part of #338).
newestWorkspaceMtimejudged a plain file by its own mtime, so an old plain file whose namecheckKeyaccepts was detached and removed at a worker's start. The host janitor (deploy/sbx/janitor.sh) leaves every non-directory alone, and no workspace is ever a plain file, so the sweep now keeps it. A symlink named as a key is still removed as the link itself, never followed, as #954 documents.remote-worker/internal/vmpool/startup_sweep.go: a plain file returns "keep" fromnewestWorkspaceMtime; the comment says so.startup_sweep_test.go:TestStartupSweepKeepsAnOldPlainFileNamedAsAKeyfails before the change (the file is removed) and passes after;go vet ./...andgo test ./...inremote-workerpass.Assisted-By: Claude Code