aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-04-19 16:17:29 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-04-19 17:13:42 +0200
commita219f34e4d6fca2f29542585ada7b6e911999d69 (patch)
tree4c074060435c7554f9b750f364423aba4be1cb42
parentd341bdbd6837aa0214ee9dfd1c3ddfc58c2a0c9c (diff)
dashboard: limit the number of new patch retesting jobs
There are bugs with dozens of reproducers. Let's prevent them from blocking patch retesting for other bugs by limiting the number of patch retesting jobs we create for each bug at once.
-rw-r--r--dashboard/app/jobs.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/dashboard/app/jobs.go b/dashboard/app/jobs.go
index f38b8ab62..19469e44a 100644
--- a/dashboard/app/jobs.go
+++ b/dashboard/app/jobs.go
@@ -386,6 +386,10 @@ func decommissionedInto(jobMgr string) []string {
return ret
}
+// There are bugs with dozens of reproducer.
+// Let's spread the load more evenly by limiting the number of jobs created at a time.
+const maxRetestJobsAtOnce = 5
+
func handleRetestForBug(c context.Context, bug *Bug, bugKey *db.Key,
managers map[string]dashapi.ManagerJobs) (*Job, *db.Key, error) {
crashes, crashKeys, err := queryCrashesForBug(c, bugKey, maxCrashes())
@@ -395,6 +399,7 @@ func handleRetestForBug(c context.Context, bug *Bug, bugKey *db.Key,
var job *Job
var jobKey *db.Key
now := timeNow(c)
+ jobsLeft := maxRetestJobsAtOnce
for crashID, crash := range crashes {
if crash.ReproSyz == 0 && crash.ReproC == 0 {
continue
@@ -411,6 +416,10 @@ func handleRetestForBug(c context.Context, bug *Bug, bugKey *db.Key,
if manager == "" || !managers[manager].TestPatches {
continue
}
+ if jobsLeft == 0 {
+ break
+ }
+ jobsLeft--
// Take the last successful build -- the build on which this crash happened
// might contain already obsolete repro and branch values.
build, err := lastManagerBuild(c, bug.Namespace, manager)