dmvk commented on a change in pull request #18901:
URL: https://github.com/apache/flink/pull/18901#discussion_r814771389



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/highavailability/KubernetesStateHandleStore.java
##########
@@ -379,39 +456,51 @@ public StringResourceVersion exists(String key) throws 
Exception {
     public boolean releaseAndTryRemove(String key) throws Exception {
         checkNotNull(key, "Key in ConfigMap.");
         final AtomicReference<RetrievableStateHandle<T>> stateHandleRefer = 
new AtomicReference<>();
-
-        return kubeClient
-                .checkAndUpdateConfigMap(
-                        configMapName,
+        return updateConfigMap(
                         configMap -> {
-                            if (isValidOperation(configMap)) {
-                                final String content = 
configMap.getData().remove(key);
-                                if (content != null) {
-                                    try {
-                                        
stateHandleRefer.set(deserializeObject(content));
-                                    } catch (IOException e) {
-                                        LOG.warn(
-                                                "Could not retrieve the state 
handle of {} from ConfigMap {}.",
-                                                key,
-                                                configMapName,
-                                                e);
+                            final String content = 
configMap.getData().get(key);
+                            if (content != null) {

Review comment:
       that's subjective, then you'd have two return statements far away from 
each other which is IMO worse




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to