From eb07c88931c84d1d7ba1c1741fbeba42afc230c0 Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Mon, 1 Aug 2022 11:11:32 -0500 Subject: [PATCH] [Heartbeat] Limit browser jobs to 2 by default Fixes #32082 by limiting browser jobs to 2 --- heartbeat/config/config.go | 8 +++++++- heartbeat/scheduler/scheduler.go | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/heartbeat/config/config.go b/heartbeat/config/config.go index 93ee0b7556b..809ebb3f9ca 100644 --- a/heartbeat/config/config.go +++ b/heartbeat/config/config.go @@ -46,4 +46,10 @@ type Scheduler struct { } // DefaultConfig is the canonical instantiation of Config. -var DefaultConfig = Config{} +var DefaultConfig = Config{ + Jobs: map[string]JobLimit{ + "browser": { + Limit: 2, + }, + }, +} diff --git a/heartbeat/scheduler/scheduler.go b/heartbeat/scheduler/scheduler.go index 2439be7282d..17702dcbf19 100644 --- a/heartbeat/scheduler/scheduler.go +++ b/heartbeat/scheduler/scheduler.go @@ -76,6 +76,7 @@ func getJobLimitSem(jobLimitByType map[string]config.JobLimit) map[string]*semap jobLimitSem := map[string]*semaphore.Weighted{} for jobType, jobLimit := range jobLimitByType { if jobLimit.Limit > 0 { + logp.L().Info("limiting to %d concurrent jobs for '%s' type", jobLimit, jobType) jobLimitSem[jobType] = semaphore.NewWeighted(jobLimit.Limit) } }