Skip to content

Commit

Permalink
util: Resolve RuntimeStatsColl potential unlock mutex (#55118) (#55649)
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 8253658 commit 4fa424b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/execdetails/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,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 = &RootRuntimeStats{}
Expand All @@ -611,7 +612,6 @@ func (e *RuntimeStatsColl) RegisterStats(planID int, info RuntimeStats) {
stats.groupRss = append(stats.groupRss, []RuntimeStats{info})
}
}
e.mu.Unlock()
}

// GetRootStats gets execStat for a executor.
Expand Down

0 comments on commit 4fa424b

Please sign in to comment.