[#37198] Make withBackOffSupplier public to enable bounded retry configuration#37356
[#37198] Make withBackOffSupplier public to enable bounded retry configuration#37356damccorm merged 3 commits intoapache:masterfrom
Conversation
…y configuration Users need to configure bounded backoff to prevent infinite retry loops. Making withBackOffSupplier public allows users to set FluentBackoff.DEFAULT.withMaxRetries(n) and control retry behavior. Changes: - Changed withBackOffSupplier() visibility from package-private to public - Added comprehensive integration test with zero-delay BoundedBackOff - Test verifies: responses empty, 1 failure emitted, call count = maxRetries+1 The test uses a serializable BoundedBackOff class with assertions on both PAssert (pipeline outputs) and Metrics (retry counts) to ensure bounded retry behavior works correctly. Fixes apache#37198 Related to apache#37176 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of ChangesHello @PDGGK, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical limitation in Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Assigning reviewers: R: @Abacn for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
sdks/java/io/rrio/src/main/java/org/apache/beam/io/requestresponse/RequestResponseIO.java
Outdated
Show resolved
Hide resolved
Address review feedback from @damccorm to explicitly add the public keyword to withSleeperSupplier() for consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Break long line to comply with code style requirements. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
What changes are being proposed in this pull request?
This PR addresses issue #37198 by making the
withBackOffSupplier()method public in RequestResponseIO, allowing users to configure bounded backoff to prevent infinite retry loops.Problem
Users cannot configure bounded retries because the
withBackOffSupplier()method has package-private visibility. This leads to:FluentBackoff.DEFAULT.withMaxRetries(3))Solution
Changed
withBackOffSupplier()visibility from package-private topublic:This allows users to configure bounded retries:
Testing
Added comprehensive integration test
givenBoundedBackoff_thenRetriesStopAfterLimit()that:BoundedBackOffclass with zero delays (no real sleeps)PAssertthat responses are empty and exactly 1 failure is emittedTest results:
./gradlew :sdks:java:io:rrio:checkpassesImpact
Fixes #37198
Related to #37176