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
{{ message }}
Repository navigation
Allow suppressing/downgrading the "Uncaught error during event processing" log without disabling retry (for exceptions handled in updateErrorStatus) #3418
When a Reconciler throws an exception that is deliberately handled in updateErrorStatus and classified as expected & retryable (e.g. "waiting for a dependency that isn't present yet"), there is currently no way to keep JOSDK's native retry (exponential backoff via @GradualRetry) while suppressing or downgrading the EventProcessor "Uncaught error during event processing" log. Retry and that log are the same code path.
Why they can't be separated today
In ReconciliationDispatcher.handleErrorStatusHandler, the updateErrorStatus result only avoids re-throwing when isNoRetry() is set:
So any retry-enabled control rethrows e, which becomes exceptionDuringExecution, which triggers EventProcessor.handleRetryOnException — and that single method both schedules the retry and emits the WARN via retryAwareErrorLogging. The only built-in escape is withNoRetry() (also implied by ErrorStatusUpdateControl.rescheduleAfter()), which suppresses the log but disables native retry: you lose the @GradualRetry exponential backoff and the retry counter, and would have to reimplement backoff via flat rescheduleAfter.
With @GradualRetry(maxAttempts = -1) it's permanent: isLastAttempt() is never true, so every attempt hits the WARN branch — a continuous stream of WARN + stack trace for an entirely expected condition, and duplicate logging on top, since the exception is already logged at the level chosen inside updateErrorStatus.
Workarounds and why they're insufficient
withNoRetry() / rescheduleAfter(...): removes the WARN but disables native exponential-backoff retry.
Lowering the EventProcessor logger to ERROR: global to the class, can't distinguish handled/expected from genuinely unexpected errors, and relies on logger-name coupling rather than the SDK API.
Precedent
The same area already does selective, level-aware downgrading: the status-patch failure path in handleErrorStatusHandler downgrades 409/422 to DEBUG when the next reconciliation is imminent, and retryAwareErrorLogging special-cases a 409 KubernetesClientException to info. Treating some handled exceptions as not-worth-a-WARN is already an established pattern — this asks to make it user-controllable.
Proposed directions (open to design)
Let ErrorStatusUpdateControl carry a logging hint while still retrying — e.g. withoutDefaultErrorLogging() or withErrorLogLevel(Level.INFO). Leaves isNoRetry() untouched (retry/backoff intact) and lets the place that already classifies the error decide how loud the framework should be.
A configurable log level / logging callback for the "uncaught error" messages via ConfigurationService or controller configuration.
Skip or downgrade the WARN when updateErrorStatus returned a non-default control (the user demonstrably handled it), opt-in to preserve current behavior.
Environment
java-operator-sdk: 6.4.3 (behavior present on main).
@benkeil regarding the expected logic here, what I would propose is that if user NOT return 'ErrorStatusUpdateControl.defaultErrorProcessing()` thus returns in case of an error:
ErrorStatusUpdateControl.patchStatus or .noStatusUpdate or .withNoRetry that log won't be warning, just a log on debug level. WDYT?
Activity
csviri commentedon Jun 17, 2026
thank you @benkeil , will take a look soon
csviri commentedon Jun 25, 2026
@benkeil regarding the expected logic here, what I would propose is that if user NOT return 'ErrorStatusUpdateControl.defaultErrorProcessing()` thus returns in case of an error:
ErrorStatusUpdateControl.patchStatusor.noStatusUpdateor.withNoRetrythat log won't be warning, just a log on debug level. WDYT?csviri commentedon Jun 30, 2026
cc @xstefank @metacosm
benkeil commentedon Jun 30, 2026
Sorry, I will check tomorrow!
benkeil commentedon Jul 2, 2026
Easiest solution - good enough for me :)
csviri commentedon Jul 14, 2026
@benkeil I attached a PR please take a look. thank you!