Skip to content

Port/ceralive 2026 09 - #20

Merged
datagutt merged 4 commits into
mainfrom
port/ceralive-2026-09
Sep 24, 2026
Merged

datagutt merged 4 commits into
mainfrom
port/ceralive-2026-09

Conversation

@datagutt

@datagutt datagutt commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • The sender now shuts down cleanly when it receives SIGTERM or SIGINT.
    • Builds can use the system allocator by disabling default features; the default allocator remains unchanged.
  • Bug Fixes
    • Network simulation processes now shut down reliably when wrapper and inner processes use different process groups.

`cargo deny check advisories` fails on main with `error[yanked]: detected
yanked crate` for chacha20 0.10.1, pulled in transitively by
rand 0.10.2 -> network-sim (a dev-dependency), because deny.toml sets
`yanked = "deny"`. 0.10.2 is published and not yanked, so
`cargo update -p chacha20` is the remedy the tool itself suggests; the
advisory gate is not relaxed.

Same fix as CERALIVE/srtla-send-rs 9c6e35c.
… own PIDs

`NamespaceProcess::kill` signalled `-<child pid>`, assuming the tracked
`sudo ip netns exec` child led its own process group. It does not:
`spawn_with_env` uses a plain `Command::spawn()`, so the wrapper inherits
the harness's group and its PID is not a PGID. `kill -- -<pid>` therefore
fails ESRCH, the error was discarded by `let _ =`, and the trailing
`self.child.wait()` could block forever on a process nothing had
signalled.

Teardown now signals the exact PIDs `ip netns pids` reports, polls for
their disappearance under bounded TERM-then-KILL grace periods, and is
idempotent across the explicit `kill()` in `stop()` plus `Drop`.

This signals every process in the namespace, not only the one being
killed. That is correct for whole-stack teardown, the only caller today,
and is documented on `kill()` as unsuitable for stopping one process
mid-test while another in the same namespace must keep running.

Pinned by `kill_returns_when_wrapper_and_inner_process_have_mismatched_groups`,
which reproduces the three-group shape without needing privileges.

Found and fixed by CERALIVE/srtla-send-rs 4f258c7 (Andres Cera); this is
the kill logic from that commit. Its companion change to a bounded
64 KiB log tail is deliberately not taken: netns_stall_gate asserts on
mid-run log lines and several netns tests scan the whole run for panics,
both of which a tail would silently drop at RUST_LOG=debug.
mimalloc was an unconditional dependency and global allocator. It is now
optional behind a `mimalloc` feature that is in `default`, so the shipped
binary links it exactly as before, while `--no-default-features` builds
the binary and the test harness against the system allocator for
profiling and allocator-sensitive tooling.

Verified with nm: the default build carries mi_malloc symbols, the
--no-default-features build carries none.

Ported from CERALIVE/srtla-send-rs f0e33ab (Andres Cera).
The sender only handled SIGHUP, so SIGTERM and SIGINT killed it through
the default signal action and a supervisor saw a signal death rather than
a clean stop. Both now return `Ok(())` from the event loop, so the
process logs the shutdown and exits 0.

There is nothing to release on the way out (the control socket path is
only unlinked at startup), so this carries no shutdown-hook machinery.

`tests/signal_shutdown.rs` spawns the real binary and pins a prompt exit
code 0 for both signals. The handlers are registered after the
"listening for SRT" line is logged, so the test waits for the handler to
appear in `/proc/<pid>/status` (SigCgt) before signalling instead of
racing the default action.

Signal half of CERALIVE/srtla-send-rs d03056a (Andres Cera); its
empty-start-waits-for-SIGHUP behaviour is not taken.
@datagutt
datagutt merged commit f731164 into main Sep 24, 2026
6 checks passed
@datagutt
datagutt deleted the port/ceralive-2026-09 branch September 24, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant