You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PingingPool.bind() and FixedSizePool.bind() do not pass labels to BatchCreateSessions session_template #15872
google-cloud-spanner: 3.55.0 (also confirmed on main branch as of 2026-02-11)
Summary
PingingPool.bind() and FixedSizePool.bind() do not include user-assigned labels in the BatchCreateSessionsRequestsession_template. This means sessions created eagerly during bind() never receive the labels passed to the pool constructor, even though the labels parameter is accepted and documented.
Expected behavior
Sessions created during PingingPool.bind() should carry the labels passed via PingingPool(labels={"key": "value"}), matching the behavior of _new_session() which correctly passes labels.
Actual behavior
The session_template in bind() only includes creator_role:
As a result, only sessions lazily created via _new_session() (e.g., to replace expired sessions) receive labels. The initial batch of sessions created in bind() does not.
Include self._labels (or self.labels) in the session_template passed to BatchCreateSessionsRequest in both PingingPool.bind() and FixedSizePool.bind():
The Spanner API's BatchCreateSessionsRequest.session_template already supports labels — we confirmed that passing labels in the template correctly applies them to all created sessions.
Activity
rahul2393 commentedon Feb 24, 2026
Regular sessions will be removed from repo googleapis/python-spanner#1476
waiho-gumloop commentedon Feb 24, 2026
thanks @rahul2393 , I must have misunderstood the docs. I had assumed pooling and multiplexing were 2 different but compatiable layers. https://docs.cloud.google.com/spanner/docs/sessions#multiplexed_sessions
I had assumed 1 client could create a pool of multiple sessions, where each session is a multiplexed session handling multiple transactions.
From what you're describing, it sounds like
rahul2393 commentedon Feb 25, 2026
Yes, option B is default, and option A will be removed in future release.
chalmerlowe commentedon Mar 2, 2026
This issue was moved from the following repo as part of the monorepo migration: googleapis/python-spanner