Skip to content

fix(gax): make CompositeTracer completion-callback scoping best-effort - #15121

Open
jinseopkim0 wants to merge 1 commit into
mainfrom
fix-composite-tracer-callback-scope-errors
Open

jinseopkim0 wants to merge 1 commit into
mainfrom
fix-composite-tracer-callback-scope-errors

Conversation

@jinseopkim0

Copy link
Copy Markdown
Contributor

If a child ApiTracer throws from inScope() or Scope.close() during CompositeTracer completion callbacks, the exception can escape BasicRetryingFuture.handleAttempt and leave the RPC future incomplete forever, or skip sibling operation callbacks.

Wraps completion-callback scoping in a best-effort enterCallbackScope() helper that logs the first failure at WARNING (and subsequent ones at FINE) and dispatches callbacks without the scope, leaving public inScope() behavior unchanged. Adds 19 regression tests covering all 9 scoped callbacks and the end-to-end retrying future path.

b/499388983

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates CompositeTracer to handle exceptions thrown when entering or closing tracer scopes during completion callbacks, preventing RPC futures from hanging or skipping remaining callbacks. It also introduces comprehensive tests to verify this behavior. The review feedback highlights two main points: first, a suggestion to reorder assertions in the test to prevent potential flakiness from asynchronous execution; second, a concern that using a static JVM-wide AtomicBoolean to suppress duplicate warning logs could inadvertently hide critical tracer failures in other parts of the application.

@jinseopkim0
jinseopkim0 marked this pull request as ready for review November 20, 2026 23:04
@jinseopkim0
jinseopkim0 requested a review from a team as a code owner November 20, 2026 23:04
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
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.

1 participant