Skip to content

Commit

Permalink
util: Resolve RuntimeStatsColl potential unlock mutex (#55118)
Browse files Browse the repository at this point in the history
close #55042
  • Loading branch information
yibin87 authored Aug 1, 2024
1 parent da7ed5c commit b0aced8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/execdetails/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,7 @@ func NewRuntimeStatsColl(reuse *RuntimeStatsColl) *RuntimeStatsColl {
// RegisterStats register execStat for a executor.
func (e *RuntimeStatsColl) RegisterStats(planID int, info RuntimeStats) {
e.mu.Lock()
defer e.mu.Unlock()
stats, ok := e.rootStats[planID]
if !ok {
stats = NewRootRuntimeStats()
Expand All @@ -1318,7 +1319,6 @@ func (e *RuntimeStatsColl) RegisterStats(planID int, info RuntimeStats) {
if !found {
stats.groupRss = append(stats.groupRss, info.Clone())
}
e.mu.Unlock()
}

// GetBasicRuntimeStats gets basicRuntimeStats for a executor.
Expand Down

0 comments on commit b0aced8

Please sign in to comment.