-
Notifications
You must be signed in to change notification settings - Fork 131
fix: use credentials key in pool #430
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #430 +/- ##
============================================
+ Coverage 82.16% 82.23% +0.06%
- Complexity 2455 2465 +10
============================================
Files 136 138 +2
Lines 13589 13620 +31
Branches 1307 1309 +2
============================================
+ Hits 11166 11200 +34
+ Misses 1895 1892 -3
Partials 528 528
Continue to review full report at Codecov.
|
@skuruppu @thiagotnunes Friendly ping for this PR. It fixes a bug in the JDBC driver that can cause a |
hey @olavloite, I think I am missing how does assigning the |
Thanks for the quick response @thiagotnunes Assigning the You have a number of options for setting the credentials when creating a
Option 2 and 3 internally both set the
Setting a Setting a What also might be worth noting:
|
@olavloite thanks for the detailed explanation. LGTM. |
@thiagotnunes Apparently you have not (yet?) been added as a member of https://github.com/orgs/googleapis/teams/yoshi-java/members, which means that merging this PR is still blocked until a member of that team approves the PR. Maybe one of the maintainers could add you as a member to the team. |
@olavloite sorry about that, I have requested membership |
This is an auto-generated regeneration of the .pb.go files by cloud.google.com/go/internal/gapicgen. Once this PR is submitted, genbot will update the corresponding PR to depend on the newer version of go-genproto, and assign reviewers. Whilst this or any regen PR is open in go-genproto, genbot will not create any more regeneration PRs. If all regen PRs are closed, gapicgen will create a new set of regeneration PRs once per night. If you have been assigned to review this PR, please: - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. That will prompt genbot to assign reviewers to the google-cloud-go PR. Corresponding google-cloud-go PR: googleapis/google-cloud-go#2731
🤖 I have created a release \*beep\* \*boop\* --- ### [2.0.2](https://www.github.com/googleapis/java-spanner-jdbc/compare/v2.0.1...v2.0.2) (2021-04-26) ### Bug Fixes * release scripts from issuing overlapping phases ([googleapis#434](https://www.github.com/googleapis/java-spanner-jdbc/issues/434)) ([b2eec0f](https://www.github.com/googleapis/java-spanner-jdbc/commit/b2eec0f079e64f5c21b89bbc0b02e3e981d6469a)) * typo ([googleapis#431](https://www.github.com/googleapis/java-spanner-jdbc/issues/431)) ([a0b158b](https://www.github.com/googleapis/java-spanner-jdbc/commit/a0b158bf9931d610779dec51ca61107078e9398e)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([googleapis#438](https://www.github.com/googleapis/java-spanner-jdbc/issues/438)) ([aa56b5c](https://www.github.com/googleapis/java-spanner-jdbc/commit/aa56b5c1d5e3b1ccdaa0d5b877deccbda5aa0061)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([googleapis#441](https://www.github.com/googleapis/java-spanner-jdbc/issues/441)) ([df7f0e7](https://www.github.com/googleapis/java-spanner-jdbc/commit/df7f0e796c03f9607e57b4b6ba999c92ea14c58d)) * update dependency com.google.cloud:google-cloud-spanner-bom to v6.2.1 ([googleapis#430](https://www.github.com/googleapis/java-spanner-jdbc/issues/430)) ([212d9d0](https://www.github.com/googleapis/java-spanner-jdbc/commit/212d9d05c4f28ade71ab5484792188b11a5bcd8b)) * update dependency com.google.cloud:google-cloud-spanner-bom to v6.3.3 ([googleapis#439](https://www.github.com/googleapis/java-spanner-jdbc/issues/439)) ([a128c4c](https://www.github.com/googleapis/java-spanner-jdbc/commit/a128c4cbe0e6b66f9276b71f7733a46645186e88)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
The
SpannerPool
uses among other fields thecredentials
of aConnectionOptions
to determine whether an existingSpanner
instance can be reused or not. Certain credentials instances, most notablyUserCredentials
, are mutable and the result ofequals(Object)
andhashCode()
of an instance may change during its lifetime. This could cause theSpannerPool
to inadvertently close aSpanner
instance that is still in use.This change replaces the usage of the actual credentials as part of the pool key with a key that is based on the method that was used to determine the credentials. This ensures that if two connections request a
Spanner
instance using the samecredentialsUrl
, that they will be considered equal. The same also applies to two connections that both do not set any specific credentials options and use the application default credentials.Fixes googleapis/java-spanner-jdbc#206 and GoogleCloudPlatform/google-cloud-spanner-hibernate#202