Skip to content

Commit 8ee5d05

Browse files
authored
fix(spanner): add safecheck to avoid deadlock when creating multiplex session (#11131)
1 parent 4250788 commit 8ee5d05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spanner/session.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,10 @@ func (p *sessionPool) createMultiplexedSession() {
906906
p.mu.Lock()
907907
p.multiplexedSessionCreationError = err
908908
p.mu.Unlock()
909-
p.mayGetMultiplexedSession <- true
909+
select {
910+
case p.mayGetMultiplexedSession <- true:
911+
case <-c.ctx.Done():
912+
}
910913
continue
911914
}
912915
p.sc.executeCreateMultiplexedSession(c.ctx, client, p.sc.md, p)

0 commit comments

Comments
 (0)