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

perf: remove repeated GetSession calls for FixedSizePool #1252

Merged
merged 22 commits into from
Dec 5, 2024

Conversation

olavloite
Copy link
Contributor

Add a _last_use_time to Session and use this to determine whether the FixedSizePool should check whether the session still exists, and whether it should be replaced. This significantly reduces the number of times that GetSession is called when using FixedSizePool.

Adds a DatabaseAdminService to the mock server and sets up a basic
test case for this.

Also removes the generated stubs in the grpc files, as these are
not needed.
Add a _last_use_time to Session and use this to determine whether the
FixedSizePool should check whether the session still exists, and whether
it should be replaced. This significantly reduces the number of times that
GetSession is called when using FixedSizePool.
@olavloite olavloite requested review from a team as code owners December 4, 2024 15:22
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/python-spanner API. labels Dec 4, 2024
Base automatically changed from mock-server-tests to main December 5, 2024 10:17
tests/unit/test_pool.py Show resolved Hide resolved
google/cloud/spanner_v1/session.py Outdated Show resolved Hide resolved
@olavloite olavloite added the owlbot:ignore instruct owl-bot to ignore a PR label Dec 5, 2024
google/cloud/spanner_v1/session.py Outdated Show resolved Hide resolved
@olavloite olavloite enabled auto-merge (squash) December 5, 2024 13:57
@olavloite olavloite merged commit c064815 into main Dec 5, 2024
14 of 16 checks passed
@olavloite olavloite deleted the remove-repeated-get-session-calls branch December 5, 2024 15:09
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/python-spanner API. owlbot:ignore instruct owl-bot to ignore a PR size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants