Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: fuzzer/go/deduplicator/deduplicator.go

Issue 1691893002: Fuzzer now deduplicates on the analysis side instead of the download side (Closed) Base URL: https://skia.googlesource.com/buildbot@metrics
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fuzzer/go/data/testdata/stacktrace/7bad_release.err ('k') | fuzzer/go/deduplicator/deduplicator_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzzer/go/deduplicator/deduplicator.go
diff --git a/fuzzer/go/deduplicator/deduplicator.go b/fuzzer/go/deduplicator/deduplicator.go
index 88ca84c6442ad7e50ecc178d3a30280f057e0fd9..8a0dccbcc08f825a6738729f057d02fefceb30c3 100644
--- a/fuzzer/go/deduplicator/deduplicator.go
+++ b/fuzzer/go/deduplicator/deduplicator.go
@@ -2,15 +2,17 @@ package deduplicator
import (
"fmt"
+ "sync"
- "go.skia.org/infra/fuzzer/go/frontend/data"
+ "go.skia.org/infra/fuzzer/go/data"
"go.skia.org/infra/go/util"
)
const _MAX_STACKTRACE_LINES = 4
type Deduplicator struct {
- seen map[string]bool
+ seen map[string]bool
+ mutex sync.Mutex
}
func New() *Deduplicator {
@@ -20,6 +22,8 @@ func New() *Deduplicator {
}
func (d *Deduplicator) Clear() {
+ d.mutex.Lock()
+ defer d.mutex.Unlock()
d.seen = make(map[string]bool)
}
@@ -32,6 +36,8 @@ func (d *Deduplicator) IsUnique(report data.FuzzReport) bool {
if util.In("Other", report.DebugFlags) || util.In("Other", report.ReleaseFlags) {
return true
}
+ d.mutex.Lock()
+ defer d.mutex.Unlock()
if k := key(report); d.seen[k] {
return false
} else {
« no previous file with comments | « fuzzer/go/data/testdata/stacktrace/7bad_release.err ('k') | fuzzer/go/deduplicator/deduplicator_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698