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

Allow a database client to be created with min > 0 sessions #1160

@skuruppu

Description

@skuruppu

In #963 (comment), @olavloite said that if a client is created with min sessions > 0, the client creation could fail. This is because we create the session pool before creating the database connection, and the database may not exist yet.

This means that we default to min=0 sessions so the client starts up with no sessions prepared and the first create session request is sent when the first request is received. In #963, a change was made to create sessions in batches of 10 (using BatchCreateSessions). So at least, the extra latency will only be experienced in fewer requests.

Ideally we should be able to set min > 0 sessions and have them be initialized before the first request.

Metadata

Metadata

Labels

api: spannerIssues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions