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

chore: requeue on update conflict #257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ChunyiLyu
Copy link
Member

@ChunyiLyu ChunyiLyu commented Oct 17, 2024

Context

follow up from #253

Requeue when update fails with a conflict error instead of returning the error to reduce the occurence of update conflict error "the object has been modified"

2024-10-11T14:08:10Z	ERROR	Reconciler error	{"controller": "promise", "controllerGroup": "platform.kratix.io", "controllerKind": "Promise", "Promise": {"name":"bashb398b"}, "namespace": "", "name": "bashb398b", "reconcileID": "f067966e-ef3a-4ce8-b42b-939ec8cc6f01", "error": "Operation cannot be fulfilled on promises.platform.kratix.io \"bashb398b\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:324
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222

Before this PR, running system tests will produce about 60 of these errors:

k logs -n kratix-platform-system kratix-platform-controller-manager-5c86979644-pw4gt | grep "the object has been modified" | wc
Defaulted container "manager" out of: manager, kube-rbac-proxy
      60    2308   27173

With this PR:

❯ k -n kratix-platform-system logs kratix-platform-controller-manager-5c86979644-pcmmp| grep "the object has been modified" | wc
Defaulted container "manager" out of: manager, kube-rbac-proxy
      11     444    5246

@ChunyiLyu ChunyiLyu marked this pull request as draft October 17, 2024 15:55
- requeue when update fails with a conflict error instead of returning
the error to reduce the occurence of update conflict error
"the object has been modified"
@ChunyiLyu ChunyiLyu marked this pull request as ready for review October 17, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant