Skip to content

listen: a connection does not hold the listener's announcement - #1140

Merged
pdfinn merged 2 commits into
masterfrom
fix/listen-announce-fds
Nov 10, 2026
Merged

pdfinn merged 2 commits into
masterfrom
fix/listen-announce-fds

Conversation

@pdfinn

@pdfinn pdfinn commented Nov 9, 2026

Copy link
Copy Markdown
Member

Each authenticated connection listen(1) made forked the listener's fd table, so it kept the announcement's ctl and listen files for as long as it lasted. A listen killed and started again on the same address was refused (address in use) until every connection it had made ended. Meanwhile the address stayed announced with nothing taking its connections, so clients' mounts hung.

Found while recording the vision demo: the Raspberry Pi 5's video service could not be restarted while the Jetson kept its mount of it.

  • appl/cmd/listen.b: the connection starts with a table holding only 0, 1, 2 and its own data and ctl files. The table is made before the shell context is copied, because the copy opens its wait file there.
  • tests/host/listen_announce_test.sh (in CI's host list): with a connection open, listen is killed and started on the same address again. The new listen takes a connection and the old connection still works. Against the old listen it fails with failed to announce ... Address already in use, as the Pi did.
  • listen_rate_fairness_test still passes.

authenticatedcommand forked the listener's fd table, so each
connection's process kept the announcement's ctl and listen files for as
long as it lasted. A listen killed and started again on the same address
was refused ("address in use") until every connection it had made ended,
and the address stayed announced with nothing taking its connections:
clients' mounts waited for ever. Found restarting a Raspberry Pi's
video service while a Jetson kept its mount.

The connection now starts with a table holding only 0, 1, 2 and its own
data and ctl files, made before the shell context is copied (the copy
opens its wait file there). tests/host/listen_announce_test.sh fails
without it as the Pi did.
…to the changelog PR

# Conflicts:
#	CHANGELOG.md
@pdfinn
pdfinn merged commit bf42813 into master Nov 10, 2026
48 of 49 checks passed
@pdfinn
pdfinn deleted the fix/listen-announce-fds branch November 10, 2026 07:21
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