diff --git a/spanner/session.go b/spanner/session.go index 76d611fe262d..b6b8996790fc 100644 --- a/spanner/session.go +++ b/spanner/session.go @@ -926,10 +926,10 @@ func (p *sessionPool) newSessionHandle(s *session) (sh *sessionHandle) { if p.TrackSessionHandles || p.ActionOnInactiveTransaction == Warn || p.ActionOnInactiveTransaction == WarnAndClose || p.ActionOnInactiveTransaction == Close { p.mu.Lock() sh.trackedSessionHandle = p.trackedSessionHandles.PushBack(sh) - p.mu.Unlock() if p.TrackSessionHandles { sh.stack = debug.Stack() } + p.mu.Unlock() } return sh }