Skip to content

Added TopicRetryableStream with support of RetryPolicy#628

Merged
alex268 merged 8 commits into
ydb-platform:masterfrom
alex268:master
Apr 14, 2026
Merged

Added TopicRetryableStream with support of RetryPolicy#628
alex268 merged 8 commits into
ydb-platform:masterfrom
alex268:master

Conversation

@alex268

@alex268 alex268 commented Apr 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@alex268 alex268 requested a review from pnv1 April 14, 2026 11:28
@pnv1 pnv1 requested a review from Copilot April 14, 2026 11:30
Comment thread topic/src/main/java/tech/ydb/topic/impl/DebugTools.java Outdated
@codecov-commenter

codecov-commenter commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.21875% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.62%. Comparing base (84f207a) to head (2bcb0bc).

Files with missing lines Patch % Lines
.../main/java/tech/ydb/topic/impl/SerialExecutor.java 0.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TopicStream as a thin wrapper over GrpcReadWriteStream with token-update handling and message-status parsing.
  • Introduces TopicRetryableStream to restart underlying TopicStream instances according to RetryConfig (immediate and scheduled retries, plus retry counter reset).
  • Adds JUnit tests for both stream layers and tweaks SerialExecutor scheduling 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.

Comment thread topic/src/test/java/tech/ydb/topic/impl/TopicRetryableStreamTest.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/DebugTools.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicStream.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicStream.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicStream.java Outdated
Comment thread topic/src/main/java/tech/ydb/topic/impl/TopicRetryableStream.java Outdated
pnv1
pnv1 previously approved these changes Apr 14, 2026
@alex268 alex268 merged commit 0bc7e97 into ydb-platform:master Apr 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants