-
Notifications
You must be signed in to change notification settings - Fork 218
Approach to exception handling in Dependent Resource reconcile()
#1126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
reconcile()
My opinion is that as mentioned also before we should stick with the current model. Since as mentioned, I really cannot think of a scenario where this could help. However I'm open to discuss it. On the cons side however:
But mainly I cannot think of any scenario that this approach is solving / can help. |
On the side note: regarding the ReconcileResult TBH I would remove the whole enum. Basically since the reconciliation should be level based, realying on this information could lead to a bad pattern or confusion. Or at least not see how this actually should be used. |
This information is only available within one reconciliation, though. Maybe we should rename the class differently but |
So that is the main question, what action though. Originally it was We should rather create a separate issue to discuss this part. |
For now implemented this that the exception is thrown so the All the reconcile information will be still available in the context: In the status handler. We can reopen and discuss further in case. |
There have been discussion if an exception should be throwed from
DependentResource.reconcile()
implementation in case of an error. Currently this exception is thrown from it. (And handled by theErrorStatusHandler
if implemented - otherwise just the pure retry functionality activated. )This assures seamless integration of dependent resources (both managed and standalone mode). See in docs:
https://javaoperatorsdk.io/docs/features#setting-error-status-after-last-retry-attempt
https://javaoperatorsdk.io/docs/features#automatic-retries-on-error
So the idea behind this (global exception handling) that any exception happens during the reconciliation, there is little if nothing we can be done about it. So by default if an exception is thrown from the reconciler, a standard retry mechanism kicks in and we retry the whole reconciliation. With the
ErrorStatusHandler
we can basically set some status and/or prevent retry some known not recoverable errors.An alternative approach coined by @metacosm could be that
ReconcileResult
would contain the exception and a possible Erros status in it's enum.
In this issue we should discuss what would be the pros/cons of this appraoch. In what scenarios it would help and how.
The text was updated successfully, but these errors were encountered: