Dennis-Mircea Ciupitu created FLINK-41722:
---------------------------------------------
Summary: Centralize Kubernetes API failure handling in one utility
Key: FLINK-41722
URL: https://issues.apache.org/jira/browse/FLINK-41722
Project: Flink
Issue Type: Improvement
Components: Kubernetes Operator
Reporter: Dennis-Mircea Ciupitu
h1. Problem
The operator calls the Kubernetes API from many places and each one handles
failures on its own:
* {{StatusRecorder}} retries a 409 with a resource version lock.
* {{EventUtils}} has its own conflict path.
* {{ConfigMapView}} adopts an already applied write after a 409 (FLINK-41222).
* {{CanaryResourceManager}} special-cases a 404.
* {{ClusterResourceManager}} catches the client exception.
* {{KubernetesClientUtils#isCrdInstalled}} catches every {{Throwable}} and
answers "not installed".
During the FLINK-41222 review it was agreed that this class of handling does
not belong in individual call sites and should move into a dedicated utility
afterwards.
h1. Proposal
One utility for the recurring Kubernetes API patterns, used by all the call
sites above:
* a CRD or API resource probe that distinguishes "not found" from "could not
reach the API", and fails startup or retries in the second case instead of
guessing,
* a conflict aware write that re-reads on 409 and lets the caller decide
whether the stored object already matches, the pattern introduced by
FLINK-41222,
* a bounded retry for transient failures with consistent logging.
Call sites keep their semantics, only the failure handling moves. The startup
CRD check is the first consumer and the reason to do this now.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)