You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it is possible to provide a custom implementation.
117
+
118
+
It is possible to set a limit on the number of retries. In the [Context](https://github.com/java-operator-sdk/java-operator-sdk/blob/master/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/Context.java)
119
+
object information is provided about the retry, particularly interesting is the `isLastAttempt`, since a behavior
120
+
could be implemented bases on this flag. Like setting an error message in the status in case of a last attempt;
121
+
122
+
Event if the retry reached a limit, in case of a new event is received the reconciliation would happen again, it's
123
+
just won't be a result of a retry, but the new event.
124
+
125
+
A successful execution resets the retry.
126
+
127
+
### Correctness and Automatic Retries
128
+
129
+
There is a possibility to turn of the automatic retries. This is not desirable, unless there is a very specific
130
+
reason. Errors naturally happen, typically network errors can cause some temporal issues, another case is when a
131
+
custom resource is updated during the reconciliation (using `kubectl` for example), in this case
132
+
if an update of the custom resource from the controller (using `UpdateControl`) would fail on a conflict. The automatic
133
+
retries covers these cases and will result in a reconciliation, even if normally an event would not be processed
134
+
as a result of a custom resource update from previous example (like if there is no generation update as a result of the
135
+
change and generation filtering is turned on)
111
136
112
137
## Re-Scheduling Execution
113
138
139
+
In simple operators one way to implement an operator is to periodically reconcile it. This is supported explicitly by
140
+
`UpdateControl`, see method: `public UpdateControl<T> withReSchedule(long delay, TimeUnit timeUnit)`.
141
+
This would schedule a reconciliation to the future.
0 commit comments