Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(otel): avoid crashes in tracing wrappers for streams #14477

Merged
merged 11 commits into from
Jul 17, 2024

Conversation

cuiy0006
Copy link
Collaborator

@cuiy0006 cuiy0006 commented Jul 15, 2024

Fix the crash issue in

AsyncStreamingReadRpcTracing
AsyncStreamingWriteRpcTracing
AsyncStreamingReadWriteRpcTracing

The issue is caused by accessing metadata in EndSpan() before the underlying stream Start().

Closes #14458


This change is Reviewable

@cuiy0006 cuiy0006 requested a review from a team as a code owner July 15, 2024 21:46
@cuiy0006 cuiy0006 changed the title test(AsyncSteamTracing) fix crashes in tracing wrappers for streams test(AsyncSteamTracing): fix crashes in tracing wrappers for streams Jul 15, 2024
@cuiy0006 cuiy0006 changed the title test(AsyncSteamTracing): fix crashes in tracing wrappers for streams fix(AsyncSteamTracing): fix crashes in tracing wrappers for streams Jul 15, 2024
@dbolduc dbolduc changed the title fix(AsyncSteamTracing): fix crashes in tracing wrappers for streams fix(otel): avoid crashes in tracing wrappers for streams Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.59%. Comparing base (c3f7035) to head (eab9ede).

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #14477    +/-   ##
========================================
  Coverage   93.59%   93.59%            
========================================
  Files        2316     2316            
  Lines      207222   207354   +132     
========================================
+ Hits       193953   194083   +130     
- Misses      13269    13271     +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Looks good. I think we need to check the early exit condition in the End() helpers, though. Other than that, I just have nits.

Aside: I would have split this up into 3 separate PRs, even though the changes are all related / basically the same. I only looked closely at the AsyncStreamingReadWriteRpcTracing changes. The comments probably apply to the other two wrappers.

Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Optionally, remove the expectations in the unit tests for the generated golden tracing stubs. Or not. Then feel free to merge.

@cuiy0006 cuiy0006 enabled auto-merge (squash) July 17, 2024 14:59
@cuiy0006 cuiy0006 merged commit d5e2aa8 into googleapis:main Jul 17, 2024
63 checks passed
@cuiy0006 cuiy0006 deleted the fix-crash-tracing-wrapper branch July 17, 2024 15:22
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.

Avoid crashes in tracing wrappers for streams
2 participants