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: race condition when opening multiple connections in parallel as first action #59

Merged
merged 4 commits into from
Nov 2, 2021

Conversation

olavloite
Copy link
Collaborator

Fixes a potential race condition when the first action that a client application takes
is to open multiple connections in parallel. Each of these connections will try to compile
the client side statements the first time a statement is executed, but only one of them
should be allowed to do so. The rest should wait for the compilation to finish.

Also adds session configuration options to the connection string and caching of Spanner
clients that use the exact same connection string.

Fixes #58

…first action

Fixes a potential race condition when the first action that a client application takes
is to open multiple connections in parallel. Each of these connections will try to compile
the client side statements the first time a statement is executed, but only one of them
should be allowed to do so. The rest should wait for the compilation to finish.

Also adds session configuration options to the connection string and caching of Spanner
clients that use the exact same connection string.

Fixes #58
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 26, 2021
Copy link
Collaborator

@hengfengli hengfengli left a comment

Choose a reason for hiding this comment

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

LGTM.

@olavloite olavloite merged commit 0971f81 into main Nov 2, 2021
@olavloite olavloite deleted the race-condition branch November 2, 2021 17:31
@olavloite olavloite mentioned this pull request Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow adding session pool configuration to the connection string
2 participants