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.

ListDatabases unintentionally initializes a session pool for each returned database #1227

@skuruppu

Description

@skuruppu

@larkee pointed out an interesting observation in the Python library if we initialize the session pool with > 0 sessions in the context of ListDatabses and I think this might apply in Node.js as well.

  1. When we call getDatabases, the GetDatabaseResponse translates the Database protos into Database objects.
  2. Each Database object contains a SessionPool which is initialized in the constructor.

Is it an issue that we potentially create lots of sessions unnecessarily for all results of a ListDatabases call?

@olavloite assigning to you since you've looked at the pool implementation more recently.

Metadata

Metadata

Assignees

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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions