Repository navigation
fix(join): tell an account named null from none, stop the check without ps, and copy without cmp - #3995
Conversation
…ut ps, and say what was signalled Four follow-ups to #3973, in scripts/join only: - An account whose id is the text `null` was read as no account. The account read now keeps the two apart, so such a machine is named as in that account (and by the undo), never taken for one in no account. - Whether the check of the kit's server still runs is read from /proc/<pid>/stat instead of ps. On a machine without ps a live process that is no longer that server made the stop wait for ever; it is now named and the join refuses (exit 14), as with ps. - The refusal for a check that did not end says "after TERM and KILL" only when they were sent; otherwise it says the process was not signalled because it is no longer the kit's server. - The ending names the account as the one the machine is in now, instead of "the one the add above names". The container suite gains a case for a whole answer, and one cut at a nested closing brace, each followed by a stall: only the download's exit status makes them no answer (a run again is kept, exit 39). It also gains the account named null and the check on a machine without ps.
…nals the check was sent - The programs copied into the trial folder are now checked against the kit's copies by SHA-256 (sha256sum is already required) instead of cmp. A machine without diffutils, such as a minimal AlmaLinux 10, no longer stops after the yes with exit 14. - The refusal for a check of the kit's server that did not end names what it was sent: TERM, or TERM and KILL. A KILL that was skipped because the process stopped being the kit's server after TERM is no longer claimed. The container suite gains a machine without cmp: the join installs and starts its server, and the undo gives everything back.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
…one seen ended, and match each copy to its listed sum - A check of the kit's server that did not end, or could not be told, is named with its pid and with what it was sent, in English and Korean, and the join stops (exit 14). It gives no command that signals that pid: it says how to look at the process first (ps -o pid,user,args -p <pid>, or ls -l /proc/<pid>/exe) and to stop it only if it is the kit's ovis-server serve. An interruption that cannot stop it says the same. - Whether the check still runs is read as running, ended or unknown. A process with that pid that /proc does not show as the join's child (its entry unreadable, or /proc of another PID namespace) is unknown, not ended: it is refused with its pid (exit 14). The join waits on the check only once it is seen ended, so no wait in the stop is unbounded. - Each program copied into the trial folder is hashed from the copy itself (stdin) and compared with the sum the kit's SHA256SUMS lists for it, which is never empty: a sha256sum that fails matches nothing and is refused, and the copy's path no longer changes the hash, so a HOME holding a backslash reaches the settings refusal (exit 2). The container suite gains a join in a PID namespace without its own /proc (exit 14 naming the pid, no hang) and a sha256sum that fails at the copy (exit 14, rolled back); the no-ps case checks that the refusal names the pid and gives no kill command.
… refusals, and check the stand-in before the test ends it - The undo's refusal for a trial server that did not end now says how to look at the process first and to stop it only if its program is the trial's bin/ovis-server, with a Korean line first, as the check's refusal does. - The refusal after an interruption that could not stop the check says what it was sent (TERM, TERM and KILL, or nothing), in Korean and English, as the check's refusal does. - The no-ps contract case ends the stand-in it leaves running only while its program still reads as the stand-in's own deleted one.
Merge passMerged head
|
…l when a run again fails (#4973) Refs #3983 (items 2/18, 12, 14, 23/24; the rest is fixed by #3995 or low/contrived, see the issue comment). - **2 / 18:** `j_sha256` in `join.sh` and the pasted line from `kit.ts` hash the kit's files from stdin instead of passing paths to `sha256sum`, so a temporary folder whose name holds a backslash no longer fails the check (it refused with exit 16). - **12:** on a run again, the four failures after the earlier install was stopped (the copy of the kit's programs among them) now say that the install stays, stopped, and how to undo; the unused `j_rollback` is gone. - **23 / 24:** the undo's "look first" line gives one `ls -l /proc/<pid>/exe` per pid (it printed `ls -l /proc/1 2/exe`) and names the `(deleted)` form. - **14:** the README's sentence on cut-off answers now matches what `j_whole` checks. **Tests:** `scripts/join/join.local.test.ts` (new, 3 cases, outside containers: a scratch HOME, a compiled stand-in herdr, failing systemctl/loginctl stubs) and a new case in `scripts/join/kit.test.ts`. On main they fail with exit 16 / the old copy refusal / `ls -l /proc/221419 221425/exe`; with the fix, 20 pass / 0 fail (15 s on old-desktop). `sh -n` under sh, dash, bash and busybox; `scripts/conventions.test.ts`; typecheck. Changelog fragment included.
Change
Refs #3983 (items 5, 6, 7 and 8; items 1 to 4 stay open there).
Four small follow-ups to the trial join (#3973), and one found on a minimal AlmaLinux 10, all in
scripts/join/:nullwas read as no account. The account read now gives no account andan account with an id in two forms that cannot meet (
null, and the id after a=), so such a machine is namedas in that account: the ending (exit 38 when it was in it before) and the undo both say so. An account answer
with an empty id is still no answer, as before.
/proc/<pid>/stat(its state and itsparent) instead of
ps, as running, ended or unknown. A process with that pid that/procdoes not show as thejoin's child (its entry unreadable, or
/procof another PID namespace) is unknown, never ended. The join waits onthe check only once it is seen ended, so no wait in the stop is unbounded; a check still running or unknown after
the stop's 2 s is named with its pid and the join refuses (exit 14), with
psor without it.(a KILL skipped because the process stopped being the kit's server after TERM is not claimed), or that it was not
signalled because the join could not tell that it is still the kit's server. It is said in English and Korean, and
it gives no command that signals the pid: it says how to look at the process first (
ps -o pid,user,args -p <pid>,or
ls -l /proc/<pid>/exe, which shows its program, "(deleted)" once its temporary folder is gone) and to stop itonly if it is the kit's
ovis-server serve. An interruption that cannot stop the check says the same. The endingnames the account as the one the machine is in now, instead of "the one the add above names".
cmp: the officialalmalinux:10image has no diffutils, and the join usedcmponce, to check the programsit copied into the trial folder, so it stopped there after the yes (exit 14). It now hashes each copy from the copy
itself (stdin) with
sha256sum, which it already requires and checks for before the question, and compares itwith the sum the kit's
SHA256SUMSlists for that file, which is never empty. Asha256sumthat fails there givesnothing, which matches no sum, so the copy is refused (exit 14) and rolled back; and the copy's path does not
change the hash, so a HOME holding a backslash reaches the settings refusal the README names (exit 2). Dropping the
need is smaller than refusing such machines: no new requirement, and nothing else in the join uses
cmp.a body that passes the whole-object check, then stalls until curl times out: once
{"account":null}whole, oncea body cut at a nested closing brace. Only the download's exit status makes them no answer, so a run again is
kept (exit 39), never removed.
The container suite also gains:
null(exit 38 naming it; the undo says the machine was in it);ps(exit 14, the pid named, no command that signals it, nothing sent, no hang);/procof its own, where the check's/procentry cannot be read while itlives (exit 14 naming the pid, no hang);
cmp(the join installs and starts its server, exit 30 without a terminal for the add, and theundo gives everything back);
sha256sumthat fails once the programs are copied (exit 14, rolled back, nothing left).The README says each of these.
Validation
bun test scripts/join/kit.test.tsand the threeconventions.test.tsfiles: 65 pass, 0 fail.sh -n,dash -nandbash -nonjoin.sh: clean.bun run typecheck: pass.join.shand this one: main reads{"account":"null"}as no account and, withpsgone, a live child of the shell as ended; this one reads anaccount
nulland a running child (a program name holding)included). With stand-ins for the process checks(nothing signalled), a check that stops being the kit's server after TERM is said "after TERM", and one that
stays it "after TERM and KILL". With a live child's
/procentry unreadable, the stop returns after its 2 s withthe check unknown, and nothing is waited for.
OVIS_JOIN_CONTAINER_QA=1 bun test scripts/join/join.contract.test.ts), once, at thishead, on Ubuntu 24.04 containers on an internal network with a real herdr 0.9.5: 48 pass, 0 fail (602 s).
bun run check fast: pass (unit: 17890 pass, 0 fail, 54 skip).next step refuses such a value (exit 2) and rolls back.
join.shin containers, and the join on analmalinux:10machine itself(the no-
cmpcase stands in for it).