lordcheng10 commented on a change in pull request #3061:
URL: https://github.com/apache/bookkeeper/pull/3061#discussion_r808866151



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java
##########
@@ -376,7 +380,16 @@ private boolean remove(long key1, long key2, long value1, 
long value2, int keyHa
                 }
 
             } finally {
-                unlockWrite(stamp);
+                if (size < resizeThresholdBelow) {

Review comment:
       Because when get item, EmptyKey is used as the end mark, if you use size 
to judge when expanding, it may cause EmptyKey not found in map, which leads to 
infinite loop when get item:
   
https://github.com/apache/bookkeeper/blob/7018d2fff35de96a90a1008366e38580e448fb84/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java#L259-L275




-- 
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-unsubscr...@bookkeeper.apache.org

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


Reply via email to