aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-09-11 12:04:41 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-09-12 16:53:03 +0000
commit0c82e9ad8718dffc85fe43f728498ee39bbba25d (patch)
tree87a69d9560524f78f5a7be821f5c3fb8e13ff64f /pkg
parent2a91a78df9ed766fac414f94e9d3cc5fa71add55 (diff)
pkg/manager: ensure NeedRepro() is always called
Always check it before starting the actual reproduction.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/manager/repro.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/pkg/manager/repro.go b/pkg/manager/repro.go
index 038980624..8a6b1331d 100644
--- a/pkg/manager/repro.go
+++ b/pkg/manager/repro.go
@@ -198,13 +198,7 @@ func (r *ReproLoop) Loop(ctx context.Context) {
for {
crash := r.popCrash()
- for crash == nil {
- select {
- case <-r.pingQueue:
- crash = r.popCrash()
- case <-ctx.Done():
- return
- }
+ for {
if crash != nil && !r.mgr.NeedRepro(crash) {
crash = nil
// Now we might not need that many VMs.
@@ -212,6 +206,15 @@ func (r *ReproLoop) Loop(ctx context.Context) {
r.adjustPoolSizeLocked()
r.mu.Unlock()
}
+ if crash != nil {
+ break
+ }
+ select {
+ case <-r.pingQueue:
+ crash = r.popCrash()
+ case <-ctx.Done():
+ return
+ }
}
// Now wait until we can schedule another runner.