btd, mediad: a restarted daemon gets the next request, not the one after - #207
Open
Nixxx19 wants to merge 1 commit into
Open
btd, mediad: a restarted daemon gets the next request, not the one after#207Nixxx19 wants to merge 1 commit into
Nixxx19 wants to merge 1 commit into
Conversation
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 #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
BrokenPipeon 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 warningsand fmt are green.