Skip to content

3.3.0: let the caller say when a server stops - #57

Merged
pathscale merged 2 commits into
masterfrom
fix/listen-until
Sep 23, 2026
Merged

pathscale merged 2 commits into
masterfrom
fix/listen-until

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Releases 3.3.0.

WebsocketServer::listen() claimed SIGTERM and SIGINT for the whole process. nagoya allows one waiter per signal number, so a second server in the same process failed with EBUSY after binding its port; the listener was dropped and a client connecting to it waited forever. agency-proxy's WebSocket test suite hung on this: each test passes alone, and the second server in one process never answers.

  • New listen_until(stop): stops when stop resolves, registers no signal. For a process that owns its own signals or runs more than one server.
  • listen() is unchanged for callers: it delegates to the same path with the process signals.
  • The stop future is polled across loop iterations instead of being rebuilt each time.

Checked: cargo test --all-features, scripts/check-features.sh (every feature compiles standalone). check-chain.sh not run: this adds API and changes no existing signature.

Downstream: agency-proxy 0.1.11 needs ^3.3 for this.

meh added 2 commits September 23, 2026 11:49
listen() claimed SIGTERM and SIGINT for the whole process, and nagoya allows
one waiter per signal number, so a second server in the same process failed
with EBUSY after it had bound its port. Its listener was dropped and a client
connecting to that port waited forever. Any process that serves twice hits it,
and every test harness that starts a server per test does: agency-proxy's
WebSocket suite hung on exactly this.

listen_until takes the stop condition as a future and registers no signal.
listen() is unchanged and delegates to it with the process signals, so current
callers keep their behaviour. The one stop future is now polled across loop
iterations rather than rebuilt each time, so a caller's future is never dropped
half-way.
Adds WebsocketServer::listen_until.
@pathscale
pathscale merged commit f65e70a into master Sep 23, 2026
5 checks passed
@pathscale
pathscale deleted the fix/listen-until branch September 23, 2026 11:02
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