An unchanged process keeps its record, so the node's runtime is not re-created every other cycle (hq issue 210)
The process applier's unchanged path returned an outcome that said nothing about what was written; the loop recorded it like any other, erasing the digest. The next cycle found no record and re-created the daemon, the one after found a record again, and so on: the node's runtime restarted every ten minutes on every machine since it arrived. The outcome now carries the digest forward, as a file's does. The test applies one process three times and asserts the record survives an unchanged apply and no restart is asked.
This commit is contained in:
@@ -77,6 +77,11 @@ func applyProcess(ctx context.Context, r *declaration.Process, run Runner,
|
||||
// Everything about it is as declared. Still asked whether it is RUNNING, because a
|
||||
// declaration that is satisfied by a record rather than by the machine is how a stopped
|
||||
// service reports success.
|
||||
// **The record is carried forward, not re-derived.** An unchanged outcome is recorded
|
||||
// like any other, so one that said nothing about what was written erased the digest; the
|
||||
// next apply then found no record, re-created the daemon, and the one after that found a
|
||||
// record again — the node's runtime restarted every other cycle (novox/hq 04-ISSUES/210).
|
||||
out.wrote = want
|
||||
if active, err := run(ctx, "systemctl", "is-active", "--quiet", r.Name+".service"); err == nil {
|
||||
_ = active
|
||||
return out, nil
|
||||
|
||||
Reference in New Issue
Block a user