Repository navigation
fix: return protocol error for responses routed through the channel - #229
Open
Manuel1234477 wants to merge 1 commit into
Open
Manuel1234477 wants to merge 1 commit into
Manuel1234477 wants to merge 1 commit into
Conversation
`_reader_thread` only checks the `error` field on the response the reader itself is waiting for. Responses it forwards to other waiting requests were returned by `recv` as-is, so `call`/`batch_call` took `result` (null) and returned Ok instead of `Error::Protocol`.
Manuel1234477
force-pushed
the
fix/check-error-on-routed-responses
branch
from
October 12, 2026 10:07
01a5171 to
6417a0e
Compare
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.
Description
The reader thread only checks for an
errorfield on the response it's waiting for itself. Responses it hands off to other waiting requests go throughrecvwithout that check, socall/batch_callend up takingresult(which is null) and returningOk.Easiest way to hit it is a batch where the server answers out of order and one of the items errors: that item comes back as
nullinstead ofError::Protocol. Same thing can happen with concurrent calls from multiple threads. It also meansClientsees a JSON error later on instead of a protocol error, and retries/reconnects when it shouldn't.Fix is to do the same
errorcheck inrecvwhen a response comes in over the channel. Added a test with a mock stream that reproduces it (fails on master).Related to #95.
Changelog notice
nullwhen routed to another waiting request