The node-engine moves a running daemon's build aside instead of deleting it (issue 734) #147

Merged
mesh-tools merged 1 commits from fix/daemon-dir-kept into main 2026-10-26 14:16:00 +00:00
Member

Issue 734 (notes 25-26). Group fix/daemon-dir-kept with mesh-sdk.

For a process no witness judges, internal/apply/process.go removed /var/lib/mesh/daemons/ (os.RemoveAll) before unpacking the new build and restarting the unit, so the old process's working directory vanished. A build module starting a check in that second failed with "go version … cannot determine current directory: getwd: no such file or directory": 3 checks on ace today (mesh-delivery#65, mesh-catalog#492, mesh-delivery#73), the same log lines on novox.

Fix: such a process goes through witness.Retire (as judged processes already do, issue 289): its build is renamed under .witness//retired/ and the new one unpacked in its place; a retired build is removed only when no process runs from it (RunningFrom now reads /proc//cwd as well as exe); Forget keeps a retired build still in use; SweepAll covers every .witness/* directory.

Tests: TestAProcessNobodyJudgesKeepsItsDirectoryUntilItsRestart (fails on main: the cwd reads "(deleted)"); two unit-file tests folded into one (count -1). Unit suite and vet clean. Try try-1793023332415610494 passed (987 unit, 992 integration).

Notes left for later: a retired build a lingering process keeps is never said (watch.go:63 drops SweepAll's list); the sweep runs on the witness's 5 s timer.

Reviewed-by: review-daemondir@shanks at 65cd7b4787

Issue 734 (notes 25-26). Group fix/daemon-dir-kept with mesh-sdk. For a process no witness judges, internal/apply/process.go removed /var/lib/mesh/daemons/<name> (os.RemoveAll) before unpacking the new build and restarting the unit, so the old process's working directory vanished. A build module starting a check in that second failed with "`go version` … cannot determine current directory: getwd: no such file or directory": 3 checks on ace today (mesh-delivery#65, mesh-catalog#492, mesh-delivery#73), the same log lines on novox. Fix: such a process goes through witness.Retire (as judged processes already do, issue 289): its build is renamed under .witness/<name>/retired/ and the new one unpacked in its place; a retired build is removed only when no process runs from it (RunningFrom now reads /proc/<pid>/cwd as well as exe); Forget keeps a retired build still in use; SweepAll covers every .witness/* directory. Tests: TestAProcessNobodyJudgesKeepsItsDirectoryUntilItsRestart (fails on main: the cwd reads "(deleted)"); two unit-file tests folded into one (count -1). Unit suite and vet clean. Try try-1793023332415610494 passed (987 unit, 992 integration). Notes left for later: a retired build a lingering process keeps is never said (watch.go:63 drops SweepAll's list); the sweep runs on the witness's 5 s timer. Reviewed-by: review-daemondir@shanks at 65cd7b47873aec492e9b7cf29549f627a5bcc400
mesh-tools added 1 commit 2026-10-26 14:15:13 +00:00
Retire a daemon's running build instead of deleting it before the restart (issue 734)
mesh/delivery merged: source.main moved to novox/mesh-host@bba9081ca127
mesh/delivery-group group fix/daemon-dir-kept merged: every member is merged
mesh/check pass 65cd7b47873a on bba9081ca127 | carried from 94f9aa298cb8, mesh-sdk 21252194d530 | unit 971 run, 423 kept, 32 skipped | integration 976…
65cd7b4787
A process no witness judges had its directory removed before the new bundle
was unpacked and the unit restarted, so the old process ran on in a deleted
working directory: mesh-build-go's `go version` probe failed with "getwd: no
such file or directory" and refused three checks on ace on 2026-10-26, each in
the second a new build of it arrived.

Every process is now replaced the way a judged one is: its build is renamed
under .witness/<name>/retired/ and deleted only once nothing runs from it.
"Runs from it" now counts a process's working directory as well as its image,
so the children a daemon starts keep the directory too. Forget keeps a retired
build that still drains, and the witness's sweep covers every process it keeps
a directory for, judged or not.

Two unit-file tests are folded into one, so the unit count goes down by one.
Author
Member

Delivery novox/mesh-host@65cd7b47873a — merged since 2026-10-26T14:16:03Z

Source — source.main moved to novox/mesh-host@bba9081ca1. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Group fix/daemon-dir-kept: novox/mesh-host@65cd7b4787, novox/mesh-sdk@fd7d93333e

Transitions

  • 2026-10-26 14:15 (new) → proposed (announced): novox/mesh-host#147's head announced
  • 2026-10-26 14:15 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-10-26 14:16 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-host@65cd7b47873a` — **merged** since 2026-10-26T14:16:03Z **Source** — source.main moved to novox/mesh-host@bba9081ca127. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Group** `fix/daemon-dir-kept`: novox/mesh-host@65cd7b47873a, novox/mesh-sdk@fd7d93333e6b **Transitions** - 2026-10-26 14:15 (new) → proposed (announced): novox/mesh-host#147's head announced - 2026-10-26 14:15 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-10-26 14:16 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
Author
Member

mesh-delivery: the operator's Approve of this pull request's merge into main is ended: a head it covers moved on: the heads it covers are no longer the group's heads. Nothing is merged on it. The operator is asked again once the checks pass at the new head.

mesh-delivery: the operator's Approve of this pull request's merge into main is ended: a head it covers moved on: the heads it covers are no longer the group's heads. Nothing is merged on it. The operator is asked again once the checks pass at the new head.
mesh-tools merged commit bba9081ca1 into main 2026-10-26 14:16:00 +00:00
mesh-tools deleted branch fix/daemon-dir-kept 2026-10-26 14:16:01 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#147