googleapis / java-spanner Public
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: multiple calls to end of span #75
Conversation
@@ -892,7 +892,7 @@ private PooledSession take() throws SpannerException { | |||
return s.session; | |||
} | |||
} catch (Exception e) { | |||
TraceUtil.endSpanWithFailure(tracer.getCurrentSpan(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tracer.getCurrentSpan()
is called outside of scope, which means endSpanWithFailure
will execute on either READ_WRITE_TRANSACTION or READ_ONLY_TRANSACTION span instead of WAIT_FOR_SESSION span.
@rghetia Could you please review PR? |
span.setStatus(Status.INTERNAL.withDescription(e.getMessage())); | ||
} | ||
} | ||
|
||
static void endSpanWithFailure(Span span, Throwable e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is endSpanWithFailure used anywhere now? If not then please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been used in a few places (ex: singleUse) where span does not end except when there is a failure.
See: https://github.com/googleapis/google-cloud-java/pull/2677/files#r157323309 for original reason.
Thank you so much @mayurkale22 and @olavloite for reproducing the problem and working on the fix. I really appreciate it. Great work.
@olavloite could you please help me to fix the tests? Here is the issue: When I ran |
@mayurkale22 |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the |
Thanks for the help.
I managed to repro-d the issue in |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the |
55f9dcb
to
02563ec
Compare
@olavloite I have added a few more tests and attempted to fix remaining issues, PTAL c0689bd when you get a chance. |
LGTM.
I don't quite get where the dependency problem is coming from. It can be fixed by adding the following to the <ignoredDependencies>
tag in the pom.xml
: com.google.errorprone:error_prone_annotations
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
Great. Finally, build is passed. |
@rghetia would like to get your eyes on OpenCensus related changes. Please review when you get a chance. |
@skuruppu I think this is good to merge now. |
Fixes #71