-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix message loss between poll() and close() (#110)
* fix message loss between poll() and close() poll() keeps a cache of exceptions per partition and throws the exception in the subsequent poll(). poll() when it gets an exception it seeks past the offset that had the exception assuming next poll() will always be called which will throw the exception. This behavior can lead to message loss if the poll() is not called again and the offsets are commit (which have already moved forward by 1). The fix stores the current offset and resume offset along with the exception. On exception, it seeks to current offset (before exception) along with resume offset (current + 1). On next poll(), it will seek past the offset which hit the exception while throwing the exception to the user. If the user decides to ignore the exception the offset has already moved past the offset with exception and normal processing will continue. If the previous poll() hit an exception and the following poll() call will only throw the exception if any unpaused partition had an exception. Otherwise, it'll clear the exceptions but will keep the offsets unchanged. On seek*(), it clear any record processing exceptions that are cached. On exit, the user can safely commit offsets it consumed (excluding the offset that hit an exception) without losing messages.
- Loading branch information
1 parent
dba98bc
commit 64c130b
Showing
5 changed files
with
298 additions
and
30 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
Oops, something went wrong.