Skip to content

Commit

Permalink
fix incorrect scaling behaviour with buffer capacity in some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hatsuyuki15 committed Sep 15, 2022
1 parent 9ffff59 commit c6ba099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (p *planner) Plan(ctx context.Context) error {

ctx = logger.WithContext(ctx, log)

free := max(capacity-running-p.buffer, 0)
diff := serverDiff(pending, free, p.cap)
free := max(capacity-running, 0)
diff := serverDiff(pending+p.buffer, free, p.cap)

// if the server differential to handle the build volume
// is positive, we can reduce server capacity.
Expand Down

0 comments on commit c6ba099

Please sign in to comment.