Skip to content
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

fix: refine retryAwareErrorLogging #2748

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,29 @@ private void retryAwareErrorLogging(
boolean eventPresent,
Exception exception,
ExecutionScope<P> executionScope) {
if (!eventPresent
&& !retry.isLastAttempt()
&& exception instanceof KubernetesClientException ex) {
if (ex.getCode() == HttpURLConnection.HTTP_CONFLICT) {
log.debug(
"Full client conflict error during event processing {}", executionScope, exception);
log.warn(
"Resource Kubernetes Resource Creator/Update Conflict during reconciliation. Message:"
+ " {} Resource name: {}",
ex.getMessage(),
ex.getFullResourceName());
return;
}
if (!retry.isLastAttempt()
&& exception instanceof KubernetesClientException ex
&& ex.getCode() == HttpURLConnection.HTTP_CONFLICT) {
log.debug("Full client conflict error during event processing {}", executionScope, exception);
log.info(
"Resource Kubernetes Resource Creator/Update Conflict during reconciliation. Message:"
+ " {} Resource name: {}",
ex.getMessage(),
ex.getFullResourceName());
} else if (eventPresent || !retry.isLastAttempt()) {
log.warn(
"Uncaught error during event processing {} - but another reconciliation will be attempted"
+ " because a superceding event has been recieved or another retry attempt is"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ " because a superceding event has been recieved or another retry attempt is"
+ " because a superseding event has been received or another retry attempt is"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #2755

+ " pending.",
executionScope,
exception);
} else {
log.error(
"Uncaught error during event processing {} - no superceding event is present and this is"
+ " the retry last attempt",
executionScope,
exception);
}
log.error("Error during event processing {}", executionScope, exception);
}

private void cleanupOnSuccessfulExecution(ExecutionScope<P> executionScope) {
Expand Down