diff --git a/spanner/session.go b/spanner/session.go index 3804d0aa4fe2..e07f67dedf3e 100644 --- a/spanner/session.go +++ b/spanner/session.go @@ -906,7 +906,10 @@ func (p *sessionPool) createMultiplexedSession() { p.mu.Lock() p.multiplexedSessionCreationError = err p.mu.Unlock() - p.mayGetMultiplexedSession <- true + select { + case p.mayGetMultiplexedSession <- true: + case <-c.ctx.Done(): + } continue } p.sc.executeCreateMultiplexedSession(c.ctx, client, p.sc.md, p)