Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oomtest: fix data race at the oomCapture #43121

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions executor/oomtest/oom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ func (h *oomCapture) AddMessageFilter(vals ...string) {
}

func (h *oomCapture) ClearMessageFilter() {
h.mu.Lock()
defer h.mu.Unlock()
h.messageFilter.Clear()
}

Expand Down Expand Up @@ -255,7 +257,9 @@ func (h *oomCapture) Write(entry zapcore.Entry, fields []zapcore.Field) error {
if end == -1 {
panic("end not found")
}
h.mu.Lock()
h.tracker = str[begin+len("8001]") : end]
h.mu.Unlock()
return nil
}
// They are just common background task and not related to the oom.
Expand Down