fix: retry CreateSession also when waitForMinSessions is zero by olavloite · Pull Request #4360 · googleapis/java-spanner · GitHub
Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

fix: retry CreateSession also when waitForMinSessions is zero#4360

Merged
olavloite merged 2 commits into
mainfrom
retry-create-session
Feb 24, 2026
Merged

fix: retry CreateSession also when waitForMinSessions is zero#4360
olavloite merged 2 commits into
mainfrom
retry-create-session

Conversation

@olavloite

Copy link
Copy Markdown
Collaborator

The creation of a session at startup would only be retried if waitForMinSessions was set. This changed introduces retries for CreateSession at startup if the error code is potentially transient. The number of retries is set to maximum 10.

The creation of a session at startup would only be retried if waitForMinSessions was set.
This changed introduces retries for CreateSession at startup if the error code is
potentially transient. The number of retries is set to maximum 10.
@olavloite olavloite requested review from a team as code owners February 20, 2026 12:32
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Feb 20, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces retry logic for CreateSession at startup, which is a valuable improvement for handling transient network issues. The implementation in MultiplexedSessionDatabaseClient.java is sound. I've added one suggestion to replace a magic number with a named constant to improve code maintainability. Additionally, please note that the new test file google-cloud-spanner/src/test/java/com/google/cloud/spanner/ExcludeFromChangeStreamTest.java appears to be unrelated to the scope of this pull request and may have been included unintentionally.

@olavloite olavloite merged commit 9263972 into main Feb 24, 2026
33 of 34 checks passed
@olavloite olavloite deleted the retry-create-session branch February 24, 2026 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants