File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ private void handleRetryOnException(ExecutionScope executionScope) {
162162 }
163163 Optional <Long > nextDelay = execution .nextDelay ();
164164
165- nextDelay .ifPresent (
165+ nextDelay .ifPresentOrElse (
166166 delay -> {
167167 log .debug (
168168 "Scheduling timer event for retry with delay:{} for resource: {}" ,
@@ -171,6 +171,9 @@ private void handleRetryOnException(ExecutionScope executionScope) {
171171 eventSourceManager
172172 .getRetryTimerEventSource ()
173173 .scheduleOnce (executionScope .getCustomResource (), delay );
174+ },
175+ () -> {
176+ log .error ("Exhausted retries for {}" , executionScope );
174177 });
175178 }
176179
Original file line number Diff line number Diff line change 66
77import io .fabric8 .kubernetes .api .model .KubernetesResourceList ;
88import io .fabric8 .kubernetes .client .CustomResource ;
9+ import io .fabric8 .kubernetes .client .KubernetesClientException ;
910import io .fabric8 .kubernetes .client .dsl .MixedOperation ;
1011import io .fabric8 .kubernetes .client .dsl .Resource ;
1112import io .javaoperatorsdk .operator .api .Context ;
@@ -53,6 +54,13 @@ public void setEventSourceManager(EventSourceManager eventSourceManager) {
5354 public PostExecutionControl handleExecution (ExecutionScope <R > executionScope ) {
5455 try {
5556 return handleDispatch (executionScope );
57+ } catch (KubernetesClientException e ) {
58+ log .info (
59+ "Kubernetes exception {} {} during event processing, {} failed" ,
60+ e .getCode (),
61+ e .getMessage (),
62+ executionScope );
63+ return PostExecutionControl .exceptionDuringExecution (e );
5664 } catch (RuntimeException e ) {
5765 log .error ("Error during event processing {} failed." , executionScope , e );
5866 return PostExecutionControl .exceptionDuringExecution (e );
You can’t perform that action at this time.
0 commit comments