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

made SqlSubsegments handle exceptions internally #189

Merged
merged 2 commits into from
Aug 4, 2020

Conversation

willarmiros
Copy link
Contributor

Description of changes:
Follow up to #186 after actually using the change, I realized that there could be some weird inconsistent state behavior the way I implemented it. An unchecked SQLException could be thrown both before and after the subsegment was begun, so it was not a guarantee that calling the method would always create a subsegment. This was a recipe for bad behavior/segment leaks.

Now, we catch all the SQL Exceptions, log useful messages, and make absolutely sure some sort of subsegment is began since that is the expected behavior.

Also exposed some of the SQL subsegment fields, since they are the publicly documented whitelisted values (e.g. won't be changing often).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Just some nits, looks good

@willarmiros willarmiros merged commit bf5f9a3 into aws:master Aug 4, 2020
@willarmiros willarmiros deleted the sql-subs branch August 4, 2020 17:56
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.

2 participants