java-operator-sdk: Slow reconciliations with JOSDK 5.0.3 release and failed reconciliation count in JOSDK metrics
Bug Report
What did you do?
We already migrated to the 5.0.2 JOSDK release with no issues but since the 5.0.3 release we are hitting some performance issues and degradation with slow reconciliations (greater than 1 second) on a rolling restart, along with some unexpected error metrics from the JOSDK:
operator_sdk_reconciliations_failed_total{exception="KubernetesClientException",group="hivemq.com",kind="HiveMQPlatform",name="test-platform",namespace="customextensionwithsubpathinstallationit",scope="namespace",version="v1"} 1.0
What did you expect to see?
No slow reconciliation (greater than 1 second) are happening and no error metrics are displayed if the reconciliation is done successfully.
What did you see instead? Under which circumstances?
Slow reconciliations (greater than 1 second) and unexpected error count metrics with same KubernetesClientException when reconciling on a rolling restart.
Environment
Kubernetes cluster type:
K3S
$ Mention java-operator-sdk version from pom.xml file
5.0.3
$ java -version
openjdk 21.0.3 2024-04-16 LTS
$ kubectl version
Client Version: v1.32.2 Kustomize Version: v5.5.0 Server Version: v1.32.0
Possible Solution
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (4 by maintainers)
but mainly glad it helped, will close this issue if no objections
Ok, I confirm that setting the
resourceVersiontonullfixes this issue. Will try to see what is causing the resource not being up-to-date.But still curious as this issue should’ve been come up as well in the 5.0.2 release. Not sure how this PR for the 5.0.3 release can affect that now.
Well unless something modifies it in the background it should, but this is clearly about the conflict, and for status patch usually there is no reason to do optimistic locking, so would just adjust it to not have there resource version.
see also: https://github.com/operator-framework/java-operator-sdk/pull/2710