Skip to content

Commit

Permalink
fix(spanner): fix data-race caused by TrackSessionHandle (#10321)
Browse files Browse the repository at this point in the history
Fixes #10320

Co-authored-by: Sri Harsha CH <[email protected]>
  • Loading branch information
egonelbre and harshachinta authored Jun 12, 2024
1 parent 203fc92 commit 23c5fff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spanner/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 23c5fff

Please sign in to comment.