Repository navigation
fix(worker): leave the event loop on a command channel error - #1914
Merged
Merged
Conversation
A worker treated an error on its command channel as a log line and went on, while a hang-up made it return. The main process closing its end with a worker answer still unread resets the Unix stream, so the worker sees EPOLLERR rather than a plain hang-up; the channel is registered edge-triggered, no further event arrives, and the worker ran forever with nothing left to drive it, so a caller joining its thread hung. Return from `Server::run` on an error exactly as on a close. The e2e test reproduces the issue's steps (answered Status, unread Status, drop the main end) and waits up to 5 s for the worker thread to finish. Fixes #1912 Signed-off-by: Florentin Dubois <[email protected]>
`cargo audit --deny warnings` (CI "cargo audit") fails on main's lockfile with two findings published after its last green run: - RUSTSEC-2026-0433: pulldown-cmark 0.13.5, quadratic parsing of nested image wikilinks with ENABLE_WIKILINKS. Fixed in 0.13.6. A build dependency only, through prost-build. - async-executor 1.14.0 is yanked. Moved to 1.14.1. Lockfile-only: both are patch updates within the existing requirements. Signed-off-by: Florentin Dubois <[email protected]>
Shine-neko
approved these changes
Nov 3, 2026
This was referenced Nov 3, 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.
Fixes #1912.
Problem
Server::run(lib/src/server.rs) returned on a hang-up of the command channel but only logged an error and continued. When the main process closes its end with a worker answer still unread, Linux resets the Unix stream, so the worker getsEPOLLERRrather than a plain hang-up. The channel is registered edge-triggered, so no further event arrives: the worker kept running with nothing left to drive it, and a caller joining its thread waited forever.Change
An error on the command channel now makes the worker return, exactly like a close. The main process can no longer reach the worker in either case.
Protocol / security impact
None on the data plane. Command-channel lifecycle only: a worker whose main process is gone now exits instead of lingering.
Tests
worker_exits_when_command_channel_errors(e2e/src/tests/command_channel_security_tests.rs) reproduces the issue's steps: an answeredStatus, then an unreadStatus, a 300 ms wait, then drop the main end. It waits up to 5 s for the worker thread to finish.worker still running 5 s after an error on its command channel(FAILED).Commands run
cargo +nightly fmt --all -- --check: exit 0cargo clippy --all-targets --locked -- -D warnings: exit 0cargo build --all-features --locked: exit 0cargo test --workspace --locked -- --skip tests::fuzz_tests::: exit 0, 3415 passed, 0 failed (e2e: 669 passed)Docs
CHANGELOG
Unreleased› Fixed.Dependencies
This branch also carries the lockfile-only commit of #1919 (
pulldown-cmark0.13.5 → 0.13.6 for RUSTSEC-2026-0433, and the yankedasync-executor1.14.0 → 1.14.1), so itscargo auditcheck passes on its own. The change is identical on every branch and merges cleanly in any order.