Repository navigation
Reload the supervised sender by its own handle, not by name - #55
Merged
Merged
Conversation
The test spawn guard listed the systemctl actions it refused, so verbs such as daemon-reload or try-reload-or-restart passed. It now accepts only known read-only verbs (show, status, is-active, list-units and similar).
The process guard now covers Bun.$, env -S, xargs, busybox and find -exec wrappers, positional sh -c forms, symlinks judged by their target, and shell scripts that signal by absolute path. process.kill reaches only the test process and processes it spawned. A PATH directory of recording stubs backs this up for by-name calls from scripts and other interpreters. The network guard now applies to backend unit tests too and covers Bun.connect, dgram, Bun.udpSocket and DNS. Client ws sockets open through one helper that calls the guard. Under mocks the remote client stays idle unless its endpoint is loopback, and name signals follow the mock gate plus a development-harness marker.
On a host without systemctl the PATH stub recorded read-only queries such as `systemctl is-enabled ssh` as violations; they now exit 127 like a missing binary. The SSH status probes live in a leaf module whose test seam the unit preload sets, so status builders never ask the host about its ssh unit and the preload loads no SSH dependency graph. The guard now covers process._kill, refuses Worker threads (where it does not run), reads shell scripts run by path or shebang (name-based signals refused, builtin kill limited to owned PIDs), follows su/runuser/script/sg command strings and chroot, and judges a proxied fetch by its proxy. The network guard stands down only in a marked private network namespace, not in any loopback-only one. Scans keep backend source off Bun.fetch and off dynamic or re-exported ws imports.
The development harness refuses DNS since the previous change, and the dev backend exited at boot: uplink health resolved the public check domain (and DNS validation its well-known name) on the host every round, then probed through mock interface names. Under mocks there is no real uplink, so the default target resolver now returns none and the active round is skipped, exactly as for an unresolvable address.
pjeweb
force-pushed
the
osb/pr/sender-signal-by-pid
branch
from
November 13, 2026 11:40
c1a5b0b to
61989a2
Compare
The bond reload sent SIGHUP to every process named srtla_send. A second sender, a diagnostic run or a sender that should survive a backend restart received the same signal. The reload now signals the live sender processes the backend spawned and tracks, and reports whether any of them received it. With one sender the signal, its target and its timing are unchanged. A foreign process with the same name is no longer signalled, and a reload that reached no supervised sender is logged instead of passing silently. The startup orphan sweep still signals by name; changing it needs ownership checks and is left for a separate change.
pjeweb
force-pushed
the
osb/pr/sender-signal-by-pid
branch
from
November 13, 2026 19:30
61989a2 to
5e35682
Compare
pjeweb
changed the base branch from
osb/pr/test-process-isolation
to
osb/base/merged-20261114.1
November 14, 2026 07:45
pjeweb
added a commit
that referenced
this pull request
Nov 16, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 17, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 17, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 18, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 18, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 19, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 21, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 22, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 23, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 24, 2026
pjeweb
added a commit
that referenced
this pull request
Nov 24, 2026
Author
|
Still carried in the integration train and not upstream, so it continues as #236. |
pjeweb
added a commit
that referenced
this pull request
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When the bond changes during a stream, the backend tells the sender to reload with
killall -HUP srtla_send. That signal reaches every process with that name on the box, not just the sender this backend started: a second sender, a diagnostic run, or later a sender that should keep running across a backend restart. A reload should only reach the sender the backend owns.What it adds
srtla_sendon the box is left alone.killall_binarysetting no longer affects the reload.How
The backend's process runner already keeps a handle (its own reference) to each process it starts. A new
signalSenders(signal)sends the signal through those handles, skips senders that have already exited, and returns how many received it.restartSrtla()uses it and reports whether at least one sender was reached. The startup sweep that clears leftover senders at boot still works by name; replacing it is left for a separate change.Stacked on #54 (test process isolation) at
50e8182ecdd5ac01f21c13d61756c4c954659f9c.Technical detail
signalSenders(signal)in the process runner signals every live sender process the backend spawned and tracks, using its own process handle, and returns how many received it. A handle whose process has already exited is skipped (Bun'skillon an exited child is a silent no-op, so the exit state is checked first).restartSrtla()uses it and returns whether at least one supervised sender received the SIGHUP. If none did, it logs a warning.With a single sender, the signal, its target process and its timing stay the same as before. The intended differences are that a foreign
srtla_sendis no longer signalled, a customkillall_binarysetting no longer affects the reload, and a reload that reached no sender is now visible instead of passing silently.Stacked on #54 at
50e8182ecdd5ac01f21c13d61756c4c954659f9c, including the stricter process/network guards and the development-backend boot fix. The sender reload change is unchanged by the rebase. The startup orphan sweep (killall srtla_sendat boot) is deliberately unchanged here. Replacing it needs ownership checks (recorded PID plus start time, or the service's own cgroup) and a decision on whether a name-only fallback should remain, so it is left for a separate change.Review fixes
Restacked onto #54's ownership and redirect fixes. The sender reload implementation is unchanged; range comparison matches the previous incremental commit exactly.
Current validation on Bun 1.4.4, one worker, transient units with UMask 0022, Nice 10, CPUWeight 50, C.UTF-8 and PID isolation: backend 12,688 pass / 19 skip / 0 fail across 1,103 files; safety and sender-reload tests 32 pass; safety with the foreign parent's proc entry hidden 27 pass. Lint/types and debt pass. The real development backend remains alive and accepts connections after 45 seconds under the safety preload, with no guard violations. The frontend and guard sources are identical to #54, whose serial Node 24 frontend run passed 7,650 tests across 459 files; shared RPC 827, i18n 797, sender 123 and hardware preflight 4 also pass there. Browser E2E was not rerun for this restack.
Tests and validation
New
sender-reload-by-pid.test.ts, written before the change. It spawns two copies of a small shell script namedsrtla_sendthat records each SIGHUP it receives: one through the process runner (tracked) and one directly (untracked). Nothing is signalled by name.false.signalSendersskips non-sender and exited processes, and counts a throwingkillas not delivered.Before the change, the three reload tests failed. After it, the full backend suite passes (12,662 pass, 19 skip, 0 fail across 1,101 files, four workers, inside a PID namespace). Root lint, backend/shared/frontend type checks, the exec guard and the tech-debt check also pass. The frontend has no code changes.
Your call
deliverdefault would become() => signalSenders("SIGHUP") > 0) when both are merged.