Skip to content

Commit

Permalink
util: Resolve RuntimeStatsColl potential unlock mutex (#55118) (#55646)
Browse files Browse the repository at this point in the history
close #55042
  • Loading branch information
ti-chi-bot authored Aug 26, 2024
1 parent 47279f5 commit 3c2d1af
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 @@ -1114,6 +1114,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 @@ -1131,7 +1132,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 3c2d1af

Please sign in to comment.