aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-20 01:26:11 +0000
committertv <tv@krebsco.de>2026-11-20 01:26:11 +0000
commitf02b09eae7e806f2fe9caa26b4975b94351d7e27 (patch)
treec043f6443dac2cfb73446bba993cb9ac3b58c300 /pkgs/populate/README.md
parent61840ec59bc13b9b2ae6d29fff7276c849684941 (diff)
populate: fail when losing the lock, keepalives for the ssh connection
The command holding the lock can end while populate runs: killed on the target, e.g. by the OOM killer, or with the shared ssh connection, e.g. when its master gets killed, after which populate's next command would start a new one, and go on without the lock. When that command ends, so does what populate runs it with, ssh or sh, which populate's child is. So Context::shell, which every command on the target goes through, before what it changes, and before the record, checks that the child is still running, failing otherwise. A run that wasn't locked throughout doesn't get recorded, and its journal stays, so the next record tells what it changed. Context keeps the lock, which clean_up releases. The keepalives end the shared connection, and with it the command holding the lock on the target, about a minute after the target stops answering, e.g. when the network fails, instead of when TCP gives up, which may take hours. lock-lost kills the command holding the lock from a pipe source.
Diffstat (limited to 'pkgs/populate/README.md')
-rw-r--r--pkgs/populate/README.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/populate/README.md b/pkgs/populate/README.md
index 8e3232d..b53fb07 100644
--- a/pkgs/populate/README.md
+++ b/pkgs/populate/README.md
@@ -256,6 +256,12 @@ the record of the run, which a systemd path unit can watch, e.g.:
`flake-input` sources whose copy got patched or got its lock file
rewritten, and `target` for `symlink` sources.
+The lock ends with the command holding it, which ends with populate, or
+with the ssh connection, which keepalives end a minute after the target
+stops answering. If it ends while populate runs, e.g. killed on the
+target, populate fails before its next command on the target, so a run that
+wasn't locked throughout doesn't get recorded.
+
Until a run finishes, populate keeps a journal in `.populate/journal` of
what it began changing, and what that changed, which the next run that
finishes sums up in its record. A `file` or `git` source whose lock file