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

feat: capture stack trace for session checkout is now optional #2350

Merged
merged 6 commits into from Apr 7, 2023

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented Mar 27, 2023

The session pool by default captures the stack trace of the thread that checks out a session of the pool, so this can be used in case the session is leaked. This is done by creating an exception already at the moment that the session is checked out. Some monitoring tools log the creation of this exception, giving the impression that the application is throwing a large number of errors, while the error is actually never thrown.
This commit makes this capturing optional. The default is to capture the call stack, but users can turn this off in the SessionPoolOptions.

Fixes #2266

The session pool by default captures the stack trace of the thread that
checks out a session of the pool, so this can be used in case the
session is leaked. This is done by creating an exception already at the
moment that the session is checked out. Some monitoring tools log the
creation of this exception, giving the impression that the application
is throwing a large number of errors, while the error is actually never
thrown.
This commit makes this capturing optional. The default is to capture the
call stack, but users can turn this off in the SessionPoolOptions.
@olavloite olavloite requested a review from a team as a code owner March 27, 2023 10:02
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels Mar 27, 2023
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner March 27, 2023 10:05
Copy link
Contributor

@rajatbhatta rajatbhatta left a comment

Choose a reason for hiding this comment

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

LGTM, apart from a couple of documentation suggestions.

@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 7, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 7, 2023
@rajatbhatta rajatbhatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 7, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 7, 2023
@olavloite olavloite merged commit 6b6427a into main Apr 7, 2023
23 checks passed
@olavloite olavloite deleted the track-call-stack-option branch April 7, 2023 19:31
gcf-merge-on-green bot pushed a commit that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.
Projects
None yet
3 participants