Skip to content

Commit

Permalink
RSDK-9720: Move read of slice length inside mutex. (#4701)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgottlieb authored Jan 10, 2025
1 parent 27ae6f5 commit e281172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftdc/ftdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ func (ftdc *FTDC) constructDatum() datum {
// can release the mutex before calling any `Stats` methods. It may be the case where the
// `Stats` method acquires some other mutex/resource. E.g: acquiring resources from the
// resource graph. Which is the starting point for creating a deadlock scenario.
statsers := make([]namedStatser, len(ftdc.statsers))
ftdc.mu.Lock()
statsers := make([]namedStatser, len(ftdc.statsers))
datum.generationID = ftdc.inputGenerationID
copy(statsers, ftdc.statsers)
ftdc.mu.Unlock()
Expand Down

0 comments on commit e281172

Please sign in to comment.