Fix topic reader flow-control stall on partition session stop#657
Draft
Eistern wants to merge 1 commit into
Draft
Fix topic reader flow-control stall on partition session stop#657Eistern wants to merge 1 commit into
Eistern wants to merge 1 commit into
Conversation
When ReadPartitionSession.stop() was called (e.g. on graceful partition eviction) any batches still sitting in readingQueue had their readFuture abandoned. Those futures are part of CompletableFuture.allOf in ReadSession#onReadResponse; if they never complete, sendReadRequest() is never invoked for that ReadResponse, the SDK never replenishes the server-side memory budget, and the whole read session stops requesting data. This restores the drain that used to live in v2.3.33 PartitionSessionImpl .shutdown() and was lost during the refactor that introduced MessageCommitter (b862816). It also closes a small race where stop() runs between the entry check and readingQueue.offer() in addBatches(). Adds a regression test that reproduces the stall on master and verifies the fix.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #657 +/- ##
============================================
+ Coverage 71.38% 71.54% +0.15%
- Complexity 3375 3379 +4
============================================
Files 379 379
Lines 15933 15938 +5
Branches 1670 1672 +2
============================================
+ Hits 11374 11403 +29
+ Misses 3909 3890 -19
+ Partials 650 645 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
When ReadPartitionSession.stop() was called (e.g. on graceful partition eviction) any batches still sitting in readingQueue had their readFuture abandoned. Those futures are part of CompletableFuture.allOf in ReadSession#onReadResponse; if they never complete, sendReadRequest() is never invoked for that ReadResponse, the SDK never replenishes the server-side memory budget, and the whole read session stops requesting data.
This restores the drain that used to live in v2.3.33 PartitionSessionImpl .shutdown() and was lost during the refactor that introduced MessageCommitter (b862816). It also closes a small race where stop() runs between the entry check and readingQueue.offer() in addBatches().
Adds a regression test that reproduces the stall on master and verifies the fix.