Skip to content

Commit

Permalink
[Heartbeat] Limit browser jobs to 2 by default
Browse files Browse the repository at this point in the history
Fixes elastic#32082 by limiting browser jobs to 2
  • Loading branch information
andrewvc committed Aug 1, 2022
1 parent a602eac commit eb07c88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion heartbeat/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
1 change: 1 addition & 0 deletions heartbeat/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit eb07c88

Please sign in to comment.