aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/manager/diff.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-09-19 14:27:43 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-10-02 08:49:35 +0000
commit11414272b7f8f8fb98d7084178e20699b6f2d759 (patch)
treedd6de0a8303f2989f8517c7cc42b02a9c02ff490 /pkg/manager/diff.go
parent267f56c68647622ed18443309598739a42bc3d31 (diff)
pkg/manager: reduce time spend under mutex
We don't need it to hold it for the call to the externally supplied callback.
Diffstat (limited to 'pkg/manager/diff.go')
-rw-r--r--pkg/manager/diff.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go
index b6423e4c9..44bd6a225 100644
--- a/pkg/manager/diff.go
+++ b/pkg/manager/diff.go
@@ -378,18 +378,14 @@ func (dc *diffContext) NeedRepro(crash *Crash) bool {
if !needReproForTitle(crash.Title) {
return false
}
- dc.mu.Lock()
- defer dc.mu.Unlock()
-
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
if dc.ignoreCrash(ctx, crash.Title) {
return false
}
- if dc.reproAttempts[crash.Title] > maxReproAttempts {
- return false
- }
- return true
+ dc.mu.Lock()
+ defer dc.mu.Unlock()
+ return dc.reproAttempts[crash.Title] <= maxReproAttempts
}
func (dc *diffContext) RunRepro(ctx context.Context, crash *Crash) *ReproResult {