mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-20 06:56:51 +00:00
Include self correction on empty batch and avoid removing pending runners when cluster is busy (#3426)
This commit is contained in:
@@ -164,6 +164,11 @@ func (l *Listener) Listen(ctx context.Context, handler Handler) error {
|
||||
}
|
||||
|
||||
if msg == nil {
|
||||
_, err := handler.HandleDesiredRunnerCount(ctx, 0, 0)
|
||||
if err != nil {
|
||||
return fmt.Errorf("handling nil message failed: %w", err)
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -177,12 +177,12 @@ func (w *Worker) HandleDesiredRunnerCount(ctx context.Context, count int, jobsCo
|
||||
"jobsCompleted", jobsCompleted,
|
||||
}
|
||||
|
||||
if w.lastPatch == targetRunnerCount && jobsCompleted == 0 {
|
||||
w.logger.Info("Skipping patch", logValues...)
|
||||
return targetRunnerCount, nil
|
||||
if count == 0 && jobsCompleted == 0 {
|
||||
w.lastPatchID = 0
|
||||
} else {
|
||||
w.lastPatchID++
|
||||
}
|
||||
|
||||
w.lastPatchID++
|
||||
w.lastPatch = targetRunnerCount
|
||||
|
||||
original, err := json.Marshal(
|
||||
|
||||
Reference in New Issue
Block a user