-
Notifications
You must be signed in to change notification settings - Fork 385
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(spanner): remove session from pool upon "not found" refresh failure #9954
Conversation
When the "SELECT 1" session-refresh query fails with "Session not found", remove the bad session from the pool, if possible. Previously we did nothing because (1) it shouldn't happen, and (2) we have other mechanisms in place to deal with bad sessions (which must remain). But it is better dealt with directly if we can. Fixes googleapis#4026.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov ReportBase: 94.21% // Head: 94.21% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #9954 +/- ##
=======================================
Coverage 94.21% 94.21%
=======================================
Files 1497 1497
Lines 140428 140489 +61
=======================================
+ Hits 132301 132362 +61
Misses 8127 8127
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
}); | ||
auto handler = | ||
[pool, session_name = refresh.second]( | ||
future<StatusOr<google::spanner::v1::ResultSet>> result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: use auto result
When the "SELECT 1" session-refresh query fails with "Session not found", remove the bad session from the pool, if possible. Previously we did nothing because (1) it shouldn't happen, and (2) we have other mechanisms in place to deal with bad sessions (which must remain). But it is better dealt with directly if we can.
Fixes #4026.
This change is