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

Added opentracing-jdbc #332

Merged
merged 1 commit into from
Nov 28, 2019
Merged

Added opentracing-jdbc #332

merged 1 commit into from
Nov 28, 2019

Conversation

whiskeysierra
Copy link
Contributor

Description

Motivation and Context

Part of #328

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

final Statement statement = info.getStatement();
final Throwable error = info.getThrowable();

decorator.onError(span, statement, error);

Choose a reason for hiding this comment

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

Is it an issue that in case the decorator fails (i.e. exception thrown in onError) that we never gonna call span.finish()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. Good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I'm curious how vendors/implementations deal with that. Technically it could be the source of a memory leak to start but never finish spans. Ideally tracers would keep only weak references to spans and discard them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a try-finally around onError but technically the onQuery could fail also and what to do with the span then? Discard (if, how)? Ignore and finish as usual?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm reading LightStep's code correctly then they don't keep a strong reference to it and abandoned spans would be garbage collected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question regarding errors during onQuery still stands though.

Choose a reason for hiding this comment

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

If onQuery fails, is afterQuery (and hence onError) called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lukasniemeier-zalando
Copy link
Member

👍

@whiskeysierra
Copy link
Contributor Author

whiskeysierra commented Nov 26, 2019 via email

@lukasniemeier-zalando
Copy link
Member

👍

@whiskeysierra whiskeysierra merged commit 07a55b6 into master Nov 28, 2019
@whiskeysierra whiskeysierra deleted the feature/jdbc branch November 28, 2019 07:09
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.

3 participants