Skip to content

Commit

Permalink
perf(spanner): grab debug stack outside of lock (#11587)
Browse files Browse the repository at this point in the history
Co-authored-by: rahul2393 <irahul@google.com>
  • Loading branch information
egonelbre and rahul2393 authored Feb 20, 2025
1 parent 4b40201 commit 0ee82ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spanner/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1103,11 +1103,11 @@ func (p *sessionPool) newSessionHandle(s *session) (sh *sessionHandle) {
return sh
}
if p.TrackSessionHandles || p.ActionOnInactiveTransaction == Warn || p.ActionOnInactiveTransaction == WarnAndClose || p.ActionOnInactiveTransaction == Close {
p.mu.Lock()
sh.trackedSessionHandle = p.trackedSessionHandles.PushBack(sh)
if p.TrackSessionHandles {
sh.stack = debug.Stack()
}
p.mu.Lock()
sh.trackedSessionHandle = p.trackedSessionHandles.PushBack(sh)
p.mu.Unlock()
}
return sh
Expand Down

0 comments on commit 0ee82ff

Please sign in to comment.