crossplane-runtime icon indicating copy to clipboard operation
crossplane-runtime copied to clipboard

Do not re-queue not recoverable requests

Open ichekrygin opened this issue 6 years ago • 3 comments

As a general rule, we requeue every failed request. However, there are cases when failures are non-recoverable and require an update to the resource definition itself (which in turn will re-queue it)

For example: If the resource contains an invalid property value

"InvalidParameterValue: Invalid database identifier"

There is no point of re-queue-int this request since the property value will not fix itself.

ichekrygin avatar Nov 03 '18 23:11 ichekrygin

This issue is going to take some thought and likely be specific to each controller. i.e. identifying the specific errors that are not recoverable will be different for each cloud provider API call.

jbw976 avatar Jun 10 '19 15:06 jbw976

I believe we can solve this somewhat systemically if crossplaneio/crossplane#593 is merged. If requeue logic becomes a function of the error returned by CRUD operations then we can assert whether an error is recoverable and have the Reconciler scaffold avoid dequeueing accordingly, i.e.:

type recoverable struct{ error }

func (r recoverable) Recoverable() {}

func Recoverable(err error) error { return recoverable{err} }

func IsRecoverable(err error) bool {
	_, recoverable := err.(interface {
		Recoverable()
	})
	return recoverable
}

https://play.golang.org/p/H5eJBA8fi8y

negz avatar Jul 19 '19 07:07 negz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 08:08 stale[bot]

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] avatar Sep 05 '24 01:09 github-actions[bot]