Skip to content

Requeue instead of erroring when the recreated AutoscalingListener already exists - #4702

Open
CloudNinjaDev wants to merge 1 commit into
actions:masterfrom
CloudNinjaDev:fix/listener-already-exists-requeue
Open

CloudNinjaDev wants to merge 1 commit into
actions:masterfrom
CloudNinjaDev:fix/listener-already-exists-requeue

Conversation

@CloudNinjaDev

Copy link
Copy Markdown

Summary

Fixes #4698.

When a runner template changes, the AutoscalingRunnerSet reconciler deletes the out-of-date listener and creates a new one. If the cache has not yet observed the replacement, Create returns AlreadyExists. That was logged as an error and returned, incrementing controller_runtime_reconcile_errors_total (and triggering alerts) even though the next reconcile recovers by itself.

AlreadyExists is now treated as transient: log at info level and requeue after one second. This mirrors the existing handling for ephemeral runner pod creation.

Testing

Local run with envtest (k8s 1.37.0, go1.27.1):

$ go build ./controllers/actions.github.com/   # ok
$ go test ./controllers/actions.github.com/ -ginkgo.focus 'AutoscalingListener|AutoscalingRunnerSet'
ok  	github.com/actions/actions-runner-controller/controllers/actions.github.com	69.814s

The existing AutoscalingRunnerSet and AutoscalingListener suites pass with the change.

…ready exists

After a runner template update the AutoscalingRunnerSet reconciler deletes
the out-of-date listener and creates a new one. If the cache has not
observed the previous object being replaced yet, Create returns
AlreadyExists, which was logged as an error and counted in
controller_runtime_reconcile_errors_total although the next reconcile
recovers on its own.

Treat AlreadyExists as a transient condition and requeue after a second,
mirroring the handling of the ephemeral runner pod creation.

Fixes actions#4698

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transient AutoscalingListener AlreadyExists error during runner-template update

1 participant