aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/manager/repro.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-04-22 17:24:38 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-04-23 09:01:11 +0000
commitd00e39af8a96f7fe18fa5664936a7d658f80eeef (patch)
tree01ed97e71880c4ad070ab95b5df6c0f36470c87f /pkg/manager/repro.go
parent6eb12242337d83872574660e27cfe2e8db463e48 (diff)
pkg/manager: better handle the reproduction queue
As pingQueue holds maximum 1 element, it's not a very good indicator of whether there are more elements in the reproduction queue. If the first few crashes happen to be no longer needed (which is quite likely when reproduction loop is started long after we have begun to collect the crashes), the loop becomes reactive - new reproductions will be started only once new bugs are submitted to the queue. Fix it by polling the queue until it returns nil. Add a test that exposes the previously existing bug.
Diffstat (limited to 'pkg/manager/repro.go')
-rw-r--r--pkg/manager/repro.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/manager/repro.go b/pkg/manager/repro.go
index f9fb2d0e2..28b676752 100644
--- a/pkg/manager/repro.go
+++ b/pkg/manager/repro.go
@@ -188,11 +188,15 @@ func (r *ReproLoop) Loop(ctx context.Context) {
for {
if crash != nil && !r.mgr.NeedRepro(crash) {
log.Logf(1, "reproduction of %q aborted: it's no longer needed", crash.FullTitle())
- crash = nil
// Now we might not need that many VMs.
r.mu.Lock()
r.adjustPoolSizeLocked()
r.mu.Unlock()
+
+ // Immediately check if there was any other crash in the queue, so that we fall back
+ // to waiting on pingQueue only if there were really no other crashes in the queue.
+ crash = r.popCrash()
+ continue
}
if crash != nil {
break