You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/01 13:21:25 UTC

[GitHub] [flink] dmvk commented on a change in pull request #19327: [FLINK-26987][runtime] Fixes getAllAndLock livelock

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
##########
@@ -411,8 +410,7 @@ private static boolean isNotMarkedForDeletion(Stat stat) {
                         final RetrievableStateHandle<T> stateHandle = getAndLock(path);
                         stateHandles.add(new Tuple2<>(stateHandle, path));
                     } catch (NotExistException ignored) {
-                        // Concurrent deletion, retry
-                        continue retry;
+                        // entry is subject for deletion and can be ignored

Review comment:
       Just a note for understanding the previous behavior.
   
   This either means that the node is marked for deletion (we can't acquire the lock) or that we're it has been already deleted (concurrent deletion).
   
   The intention of the `goto retry` was to fail fast here as we already knew the `cversion` of the root node has changed. This assumption no longer holds as it could have been simply marked for deletion. If there is a concurrent deletion happening, we'll still be able to catch that later on by the `cversion` check.
   

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
##########
@@ -411,8 +410,7 @@ private static boolean isNotMarkedForDeletion(Stat stat) {
                         final RetrievableStateHandle<T> stateHandle = getAndLock(path);
                         stateHandles.add(new Tuple2<>(stateHandle, path));
                     } catch (NotExistException ignored) {
-                        // Concurrent deletion, retry
-                        continue retry;
+                        // entry is subject for deletion and can be ignored

Review comment:
       Maybe it would be nice to expand the comment along these lines, it's rather difficult to understand why this could be ignored.




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org