Skip to content

Prevent JDBC spans from nesting#302

Merged
tylerbenson merged 2 commits into
masterfrom
tyler/jdbc-depth
May 3, 2018
Merged

Prevent JDBC spans from nesting#302
tylerbenson merged 2 commits into
masterfrom
tyler/jdbc-depth

Conversation

@tylerbenson
Copy link
Copy Markdown
Contributor

No description provided.

@tylerbenson tylerbenson added type: enhancement Enhancements and improvements inst: others All other instrumentations labels May 1, 2018
@tylerbenson tylerbenson added this to the 0.8.0 milestone May 1, 2018
@tylerbenson tylerbenson requested a review from realark May 1, 2018 00:59
} catch (final Throwable e) {
// Had some problem getting the connection.
return NoopScopeManager.NoopScope.INSTANCE;
return null;
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.

I think this could be a bug if we hit this on the first execute (callDepth == 0); the depth count won't be reset in the exit.

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.

Additionally, what gets passed to @Advice.Enter if the instrumentation throws an exception? null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point about the call depth not getting reset. Do you have any ideas on how I could work around this?

(for your second question, I'm not sure...)

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.

What do you think about explicitly decrementing the call count in the exit? That way we'll always hit 0. That may require adding a new method to the call depth local map.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think switching back to a noop scope will work better. I'll just do that.

Copy link
Copy Markdown
Contributor

@realark realark 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 👍

@tylerbenson tylerbenson merged commit 6baf095 into master May 3, 2018
@tylerbenson tylerbenson deleted the tyler/jdbc-depth branch May 3, 2018 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants