Skip to content

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

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

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

Conversation

@cnd-codeflow

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
@cnd-codeflow

Copy link
Copy Markdown
Author

Superseded by #4702, reopened from a different account.

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

2 participants