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

fix: update max_in_use_session at 10 mins interval #3570

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

surbhigarg92
Copy link
Contributor

@surbhigarg92 surbhigarg92 commented Dec 26, 2024

This PR fixes the max_in_use_session value. Currently this value is only reset at client initialization.

@surbhigarg92 surbhigarg92 requested a review from a team as a code owner December 26, 2024 10:48
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Dec 26, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 27, 2024
@@ -2048,6 +2048,7 @@ boolean isClosed() {

// Does various pool maintenance activities.
void maintainPool() {
Instant currTime = clock.instant();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do we really have to initialize here? Can we initialize before if statement inside synchronized block so that we will get exact current time. It would be okay to initialize here if we don't have synchronized block.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed that go does the same way where they are assigning right before if statement. https://github.com/googleapis/google-cloud-go/blob/main/spanner/session.go#L1775

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this currTime is used at multiple places. Inside synchronized block and outside as well. It will be an overkill if we initialize at multiple times. Inside block and outside. WDYT ?

@surbhigarg92 surbhigarg92 added the automerge Merge the pull request once unit tests and other checks pass. label Dec 31, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit cc1753d into googleapis:main Dec 31, 2024
31 of 32 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 31, 2024
sagnghos pushed a commit to sagnghos/java-spanner that referenced this pull request Jan 2, 2025
This PR fixes the max_in_use_session value. Currently this value is only reset at client initialization.
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
Development

Successfully merging this pull request may close these issues.

3 participants