You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "Hexiaoqiao (via GitHub)" <gi...@apache.org> on 2023/08/31 08:15:06 UTC

[GitHub] [curator] Hexiaoqiao commented on a diff in pull request #478: CURATOR-688. SharedCount will be never updated successful when version of ZNode is overflow.

Hexiaoqiao commented on code in PR #478:
URL: https://github.com/apache/curator/pull/478#discussion_r1311264108


##########
curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java:
##########
@@ -196,7 +196,7 @@ public boolean trySetValue(VersionedValue<byte[]> previous, byte[] newValue) thr
     private void updateValue(int version, byte[] bytes) {
         while (true) {
             VersionedValue<byte[]> current = currentValue.get();
-            if (current.getVersion() >= version) {
+            if (current.getVersion() >= version && version != Integer.MIN_VALUE) {

Review Comment:
   Thanks @eolivelli , we try to build tmp zookeeper version and create zonde with version Integer.MAX_VALUE force and this case can reappear when trySetCount this znode. When meet this issue, SharedCount#trySetCount(VersionedValue<java.lang.Integer>, int) will always return false, then application will be stuck.



-- 
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: commits-unsubscribe@curator.apache.org

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