Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle end of fetched batches of messages gracefully (#353)
The Batch read functions return io.EOF to signal the end of the batch. However, there was ambiguity because io.EOF errors could also surface for other reasons (e.g. a connection closed by the broker). Due to this ambiguity, the Reader would treat io.EOF as an error. In turn, this would result in an error message being logged and the connection being closed after every single fetch request. Such behavior is undesirable from a performance perpsective because the connection could be re-used. It is also misleading because it increases error stats and logs stats when there is really no error. This PR fixes the handling of the io.EOF in the Reader to be an expected condition meanwhile ensuring that the Batch maps any underlying io.EOF errors to io.ErrUnexpectedEOF. This PR also fixes an accidental line deletion of deadline management that was introduced in #277. Fixes #258
- Loading branch information
Steve van Loben Sels
committed
Sep 21, 2019
1 parent
46a3f29
commit 5341c5f
Showing
3 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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