aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-07-12 12:23:57 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-07-15 12:35:21 +0000
commit78b88fa490ee13dad6c85a018525c268aed4b6d3 (patch)
tree3cab2634c1fbeedb4111f01f5d4e34d7a972e6d3
parent220488044db8a4fc57f46b801779dd60d7c01979 (diff)
syz-manager: query hub only after finishing the previous batch
It does happen that we see a long tail of "candidate triage jobs" during a big influx of syz-hub programs. This is bad because in 10 minutes we'll query another batch, which will further stretch the triage process. By delaying the process more and more we're offloading the start of bug reproduction, so let's control the hub sync process more carefully - only perform the next query after the previous batch has completed.
-rw-r--r--syz-manager/hub.go3
-rw-r--r--syz-manager/manager.go4
2 files changed, 6 insertions, 1 deletions
diff --git a/syz-manager/hub.go b/syz-manager/hub.go
index e7914e37f..ba3a14ad3 100644
--- a/syz-manager/hub.go
+++ b/syz-manager/hub.go
@@ -94,6 +94,7 @@ type HubConnector struct {
type HubManagerView interface {
getMinimizedCorpus() (corpus []*corpus.Item, repros [][]byte)
addNewCandidates(candidates []fuzzer.Candidate)
+ needMoreCandidates() bool
hubIsUnreachable()
}
@@ -111,7 +112,7 @@ func (hc *HubConnector) loop() {
log.Logf(0, "connected to hub at %v, corpus %v", hc.cfg.HubAddr, len(corpus))
}
}
- if hub != nil {
+ if hub != nil && hc.mgr.needMoreCandidates() {
if err := hc.sync(hub, corpus); err != nil {
log.Logf(0, "hub sync failed: %v", err)
hub.Close()
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index faaf19965..dbd80c063 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -1499,6 +1499,10 @@ func (mgr *Manager) fuzzerLoop(fuzzer *fuzzer.Fuzzer) {
}
}
+func (mgr *Manager) needMoreCandidates() bool {
+ return mgr.fuzzer.Load().CandidateTriageFinished()
+}
+
func (mgr *Manager) hubIsUnreachable() {
var dash *dashapi.Dashboard
mgr.mu.Lock()