Added TopicRetryableStream with support of RetryPolicy#628
Merged
Conversation
pnv1
reviewed
Apr 14, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #628 +/- ##
============================================
+ Coverage 70.38% 70.62% +0.24%
- Complexity 3254 3289 +35
============================================
Files 368 371 +3
Lines 15503 15628 +125
Branches 1617 1630 +13
============================================
+ Hits 10912 11038 +126
+ Misses 3942 3937 -5
- Partials 649 653 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new streaming abstractions in tech.ydb.topic.impl to support retryable topic streams driven by RetryConfig/RetryPolicy, along with unit tests validating basic lifecycle and retry behavior.
Changes:
- Introduces
TopicStreamas a thin wrapper overGrpcReadWriteStreamwith token-update handling and message-status parsing. - Introduces
TopicRetryableStreamto restart underlyingTopicStreaminstances according toRetryConfig(immediate and scheduled retries, plus retry counter reset). - Adds JUnit tests for both stream layers and tweaks
SerialExecutorscheduling to avoid executing when there are no queued tasks.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| topic/src/main/java/tech/ydb/topic/impl/TopicStream.java | New base stream wrapper around GrpcReadWriteStream (init send, token update messages, status parsing). |
| topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java | New retrying wrapper that recreates TopicStream instances based on RetryConfig/RetryPolicy. |
| topic/src/main/java/tech/ydb/topic/impl/DebugTools.java | New helper for generating debug IDs when none is provided. |
| topic/src/main/java/tech/ydb/topic/impl/SerialExecutor.java | Adjusts scheduling condition to avoid running when queue is empty. |
| topic/src/test/java/tech/ydb/topic/impl/TopicStreamTest.java | New unit tests for TopicStream lifecycle, message handling, and token updates. |
| topic/src/test/java/tech/ydb/topic/impl/TopicRetryableStreamTest.java | New unit tests for retry behavior (immediate retry, scheduled retry, reset retries, close/start edge cases). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pnv1
previously approved these changes
Apr 14, 2026
pnv1
approved these changes
Apr 14, 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.
No description provided.