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

Downgrade StatusReasonConflict errors to debug messages #603

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

tardieu
Copy link
Member

@tardieu tardieu commented Jul 30, 2024

The codeflare-operator log is littered with update conflict errors such as:
2024-07-24T13:06:33Z ERROR Reconciler error {"controller": "AppWrapper", "controllerGroup": "workload.codeflare.dev", "controllerKind": "AppWrapper", "AppWrapper": {"name":"kevin1-team-hw","namespace":"kevin1-team"}, "namespace": "kevin1-team", "name": "kevin1-team-hw", "reconcileID": "b6e57167-a357-4c67-85d1-f455e2b57ab6", "error": "Operation cannot be fulfilled on appwrappers.workload.codeflare.dev \"kevin1-team-hw\": the object has been modified; please apply your changes to the latest version and try again"}

These update conflicts result from trying to update stale Kubernetes object revisions in etcd when multiple reconciliers (or users) are concurrently working on cached copies of these objects. These conflicts are harmless. They are handled by retrying the reconciliation loop, refreshing the cached object, and updating or patching the more recent revision. This process is entirely handled by the controller runtime but it involves returning the conflict error to the controller runtime to trigger these retries. Unfortunately, the controller runtime as a result unconditionally logs these harmless conflicts as errors, which is confusing users.

This PR therefore wraps the controller runtime logger with a filter that downgrades these log messages from ERROR to DEBUG messages, more accurately matching the gravity of the event.

@astefanutti
Copy link
Contributor

/lgtm

Copy link

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

lgtm

@astefanutti
Copy link
Contributor

/approve

Copy link

openshift-ci bot commented Aug 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astefanutti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Aug 1, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit ca81c46 into main Aug 1, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants