Repository navigation
fix: bug: topic reader close method freezes indefinitely - #920
Merged
Conversation
Signed-off-by: Robert Markovski <5818108+Roshan931@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #920 +/- ##
==========================================
- Coverage 82.68% 82.67% -0.02%
==========================================
Files 99 99
Lines 12950 12954 +4
Branches 1266 1266
==========================================
+ Hits 10708 10710 +2
- Misses 1790 1791 +1
- Partials 452 453 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Prilog <noreply@prilog.ai>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the asynchronous topic-reader close-hang fix and its supporting regression coverage.
No open issues 🎉
What changed in this PR
This pull request fixes an indefinite hang when closing an asynchronous topic reader with pending commit acknowledgements on a broken stream.
Changes:
- Stop waiting for commit acknowledgements after the stream’s first error.
- Add regression coverage for broken-stream flushing and close behavior.
- Document the fix in the changelog.
This pull request requires changes.
| File | Summary | Review notes |
|---|---|---|
ydb/_topic_reader/topic_reader_asyncio.py |
Stops pending flush operations when the stream encounters its first error. | — |
ydb/_topic_reader/topic_reader_asyncio_test.py |
Adds regression coverage for broken-stream flush and close behavior. | The regression test does not verify that an in-flight flush is released by a later stream error. Start flush() as a task, yield until it is waiting, then call _set_first_error() and await the task. |
CHANGELOG.md |
Documents the topic reader close hang fix. | — |
Review effort: Lite
Signed-off-by: Prilog <noreply@prilog.ai>
vgvoleg
approved these changes
Nov 5, 2026
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 #679
Root cause
Topic reader close(flush=True) waits forever for commit acks on an already-broken stream
Changes