Skip to content

btd, mediad: a restarted daemon gets the next request, not the one after - #207

Open
Nixxx19 wants to merge 1 commit into
pollen-robotics:mainfrom
Nixxx19:a-restarted-daemon-gets-the-next-request
Open

btd, mediad: a restarted daemon gets the next request, not the one after#207
Nixxx19 wants to merge 1 commit into
pollen-robotics:mainfrom
Nixxx19:a-restarted-daemon-gets-the-next-request

Conversation

@Nixxx19

@Nixxx19 Nixxx19 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

fixes #206

a write that fails because the peer went away is written once more on a fresh connection, in both pools. those bytes never left, so there is nothing to double up. a timeout is not retried, that is a daemon that is there and stuck, and a daemon that is genuinely gone fails the reconnect with the error that is actually true. the write itself moved into one bounded helper that drops the connection on any failure, which is what the old code did inline.

the same change in both files rather than one shared crate, because the two pools are already two copies and unifying them is a different change.

two tests, one per copy, each with a fake daemon that answers once and hangs up, then a fresh listener at the same path. both fail on main with BrokenPipe on the second send and pass now with the request reaching the new listener and its answer forwarded.

cargo test -p btd, cargo test -p mediad, clippy with -D warnings and fmt are green.

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.

the first request after a daemon restarts is answered with a broken pipe, over ble and webrtc

1 participant