Skip to content

Commit

Permalink
oomtest: fix data race in the oomtest (#43398)
Browse files Browse the repository at this point in the history
close #43396
  • Loading branch information
hawkingrei authored Apr 25, 2023
1 parent 355958a commit 451bda4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions executor/oomtest/oom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,13 @@ func (h *oomCapture) Write(entry zapcore.Entry, fields []zapcore.Field) error {
h.mu.Unlock()
return nil
}
h.mu.Lock()
defer h.mu.Unlock()
// They are just common background task and not related to the oom.
if !h.messageFilter.Empty() && !h.messageFilter.Exist(entry.Message) {
return nil
}

h.mu.Lock()
h.tracker = entry.Message
h.mu.Unlock()
return nil
}

Expand Down

0 comments on commit 451bda4

Please sign in to comment.