Repository navigation
Conversation
Contributor
Author
|
/gemini review |
Contributor
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
📋 Review Summary
This PR introduces 3-attempt retry logic for Pub/Sub topic and subscription creation in TestPubsub, TestPubsubSignal, and PubsubWriteIT to mitigate flaky integration test failures caused by transient DEADLINE_EXCEEDED and UNAVAILABLE errors. The implementation cleanly handles AlreadyExistsException / ALREADY_EXISTS on retries and preserves teardown state invariants.
🔍 General Feedback
- The retry wrappers are well-scoped, idiomatic, and align with existing resource management patterns in the codebase.
- Treating
AlreadyExistsException(andStatus.Code.ALREADY_EXISTS) as success on retry safely handles cases where a previous attempt succeeded server-side before timing out.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
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.
Summary
Fixes flaky
DeadlineExceededExceptionfailures inPostCommit SQL(PubsubTableProviderITandBeamSqlLineIT, e.g. https://github.com/apache/beam/actions/runs/42312418759, https://github.com/apache/beam/actions/runs/41878199992, https://github.com/apache/beam/actions/runs/41779718356).In
com.google.cloud.pubsub.v1,TopicAdminClient.createTopicandSubscriptionAdminClient.createSubscriptionhave a 60s RPC timeout with no default retries configured onDEADLINE_EXCEEDED/UNAVAILABLE. When a singlecreateSubscriptionorcreateTopicRPC inTestPubsub.initializePubsuborTestPubsubSignal.initializePubsubstalls for 60s againstpubsub.googleapis.com, the test immediately fails withcom.google.api.gax.rpc.DeadlineExceededException.This PR adds a 3-attempt retry helper in
TestPubsub(used by bothTestPubsubandTestPubsubSignal, similar toPubsubResourceManager) that retriescreateTopicandcreateSubscriptiononDeadlineExceededExceptionandUnavailableException(treatingAlreadyExistsExceptionon retry as success).Verification
PostCommit SQLon this branch: https://github.com/apache/beam/actions/runs/42317114490