interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / docs / NODES.md

139 lines · 9696 bytes Raw Blame History Source

Node health, the floor-edge restarts, and what forged runs outside Omega

Lane E of L1008 (card t_e5e50a41). Evidence words: IMPLEMENTED (in this tree), HOST_TESTED (run on the Spark with the named test), DEPLOYED (live), NOT_RUN.

What forged runs outside Omega

Every outside program is started with execprog: an argument list, no shell, no PATH, an empty environment, stdout into a pipe, stderr to /dev/null.

ProgramStarted fromWhat forReplacement
/usr/bin/gitserver/util.om fexec (every git page), nodes/srch.om nsrun (search), dl/dl.om (archives)read-only archive, blame, cat-file, diff, for-each-ref, format-patch, grep, log, ls-tree, rev-list, rev-parse, show on allow-listed storage (12 subcommands, from the fka after each fkgit / fkgiti in the composed source)README row 1: a seeded-Omega object reader (zlib inflate, pack index, tree walk). First step done in this lane: symbolic-ref HEAD (repository home, commits, branches and tags, in-repository search, and the clone panel) is replaced by nodes/head.om, which reads the storage HEAD file; parity in nodes/tests/ab.sh check. Next: loose and packed refs, then objects.
/usr/bin/ssh-keygensocial/20crypt.omssh-keygen -Y verify of a Radicle-key sign-in signatureREADME row 2: Ed25519 verify in Omega. Not built in this lane.

The node snapshot writer nodes/snap.om is its own program, not part of forged. It runs /usr/bin/sqlite3 -readonly (the node's two databases) and rad node status / rad node events (through /usr/bin/env HOME=..., because rad finds its node socket from HOME). Those stay host programs: sqlite3 is how the node's own database is read, and rad is the node's own interface.

Node snapshot

nodes/snap.om, built by ./run.sh deploy as server/nodes-snap, run by infra/spark/aien-nodes.service as nodes-snap follow:

nodes-snap with no argument writes once and exits (0 written, 3 or 4 a database query failed, 5 the file could not be written). Any argument other than follow is refused with exit 2 and nothing written.

The file is ~/.local/state/aien-factory/nodes.txt, mode 0600, replaced by rename. Format 2, one item per line:

  1. 2, the format
  2. unix time it was written
  3. our node id, z6MkfZDue1TbaNFi3ZzcD9uiTeduPLC52ucdFVuLKZwexxhK; readers refuse any other
  4. connected peers: rows of rad node status marked connected
  5. and on: RID scope copies behind reach wait for every repository the node has a sync record for
FieldMeaningSource
scope2 seed all, 1 seed followed, 0 not seeded herepolicies.db table seeding, policy allow
copiesother nodes that told us which version of our signed refs they holdnode.db table repo-sync-status, rows of other nodes
behindof those, how many do not hold our latest versionhead differs from our own row's head
reachseconds our latest version took to reach the slowest node that holds itthat node's row time minus our row time
waitseconds our latest version has been out while some copy still lacks it; 0 when none is behindwrite time minus our row time

The writer lists every repository it finds, at most 131072 bytes; a snapshot that would not fit is not written (exit 5), so a cut-off last line never reaches a reader. Readers accept a line only in this exact shape: a RID of 1 to 64 ASCII letters or digits, then five numbers of 1 to 19 ASCII digits, single spaces, nothing else. The time and peer lines must be 1 to 19 digits too. Anything else (markup, quotes, a 30-digit number, a 250-byte line) is dropped whole; a bad header means "not measured". Each reader then shows only its own public allow-list:

Tests (HOST_TESTED, see READY file for the run):

aien-floor-edge restarts: root cause

The unit carries the public floor page to the hub: `ssh -NT -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -R 127.0.0.1:4748:127.0.0.1:4748 hub`, Restart=always, RestartSec=5. On 2026-11-08 it restarted 1313 times.

Timeline (UTC, from the Spark user journal, the hub ssh journal and the hub tailscaled journal):

TimeWhereLine
19:48:37hub tailscaledtimeout opening (TCP <hub> => <spark>:22): the private link between the two machines dropped
19:49:06Spark, ssh of the unitTimeout, server hub not responding: after 3 x 15 s without an answer the Spark side gave up and exited
19:49 to 19:52:42Sparkeach restart: connect to host hub port 22: Connection timed out
19:52:49Sparklink back; each restart now: remote port forwarding failed for listen port 4748
19:52:49 to 21:59:43hub sshd1298 lines error: bind [127.0.0.1]:4748: Address already in use; the forge tunnel's port 18480 failed the same way
21:59:48huba new session (sshd-session 959915) binds 4748; the floor is reachable again; Spark ssh pid 3065115 has held it since

Cause: the hub never noticed that the old session was dead. Hub sshd ran with ClientAliveInterval 0 (it never asks a silent client whether it is still there), so the only thing that could end the old session was the kernel's TCP keepalive: tcp_keepalive_time 7200 s, then 9 probes 75 s apart.

WolframLanguageEvaluator: 7200 + 9*75 -> 7875 s = 2 h 11 min 15 s. WolframLanguageEvaluator: DateObject[{2026,11,8,21,59,43}] - 7875 s -> 19:48:28, which is inside the outage, consistent with the hub hearing nothing from the Spark after about 19:48:28.

So the old session, and with it its listener on 127.0.0.1:4748, lived on for 2 h 11 min after the link dropped, and every new forward in between was refused. The restarts were a symptom: the Spark end was right to reconnect; the hub end held the port.

Reproduction (nodes/evidence/control-before.txt, 2026-11-09T05:52Z): open a throwaway forward ssh -N -R 127.0.0.1:47999:127.0.0.1:9 hub, then freeze that client with SIGSTOP (it stops answering, like a dead link). After 75 s the hub still listened on 47999 (HELD), and a second forward was refused: Error: remote port forwarding failed for listen port 47999, exit 255.

Fix (on the hub, DEPLOYED 2026-11-09T05:55Z)

/etc/ssh/sshd_config.d/60-aien-client-alive.conf on the hub:

ClientAliveInterval 15
ClientAliveCountMax 3

sshd now asks a silent client every 15 s and drops it after 3 unanswered asks, so a dead session lets go of its forwarded ports within 45 s instead of 2 h 11 min. Checked with sshd -t (syntax OK), systemctl reload ssh, sshd -T (clientaliveinterval 15, clientalivecountmax 3), and a new session opened after the reload. Undo: remove the file and systemctl reload ssh.

Same test after the fix (nodes/evidence/after-fix.txt, 2026-11-09T05:55Z): after 75 s frozen the hub had released 47999 (FREE), and a second forward bound it and held it for the 20 s test window (timeout exit 124). The live floor and forge tunnels were not restarted.

The earlier attempt in this lane had installed a polling wrapper (floor-edge.sh plus a systemd drop-in) on the Spark without review. It treated the symptom, so it was removed on 2026-11-09 and the unit runs its original ssh command again.