Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

perf: remove repeated GetSession calls for FixedSizePool - #1252

Merged
olavloite merged 22 commits into
mainfrom
remove-repeated-get-session-calls
Dec 5, 2024
Merged

perf: remove repeated GetSession calls for FixedSizePool#1252
olavloite merged 22 commits into
mainfrom
remove-repeated-get-session-calls

Conversation

@olavloite

Copy link
Copy Markdown
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 teamDecember 4, 2024 15:22
@product-auto-labelproduct-auto-labelBot 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 mainDecember 5, 2024 10:17
Comment threadtests/unit/test_pool.py
Comment threadgoogle/cloud/spanner_v1/session.py Outdated
@olavloiteolavloite added the owlbot:ignore instruct owl-bot to ignore a PR label Dec 5, 2024
Comment threadgoogle/cloud/spanner_v1/session.py Outdated
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner API.owlbot:ignoreinstruct owl-bot to ignore a PRsize: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@olavloite@harshachinta@rahul2393