Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 90541200B31 for ; Tue, 24 May 2016 15:51:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8F35F160A35; Tue, 24 May 2016 13:51:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D8CCD16098E for ; Tue, 24 May 2016 15:51:14 +0200 (CEST) Received: (qmail 24240 invoked by uid 500); 24 May 2016 13:51:13 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 24099 invoked by uid 99); 24 May 2016 13:51:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2016 13:51:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E65172C1F61 for ; Tue, 24 May 2016 13:51:12 +0000 (UTC) Date: Tue, 24 May 2016 13:51:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-329) SharedValue.start() method does not update to current value if version of value currently stored in zookeeper is 0 (zero) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 24 May 2016 13:51:15 -0000 [ https://issues.apache.org/jira/browse/CURATOR-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15298192#comment-15298192 ] ASF GitHub Bot commented on CURATOR-329: ---------------------------------------- GitHub user ARascius opened a pull request: https://github.com/apache/curator/pull/153 CURATOR-329 - SharedValue does not update to current value if zookeeper node version is 0 Fixed SharedValue class to correctly update its value on start() call to value stored in Zookeeper node if node version is zero. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ARascius/curator CURATOR-329 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/curator/pull/153.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #153 ---- commit f12f35d0f78198e1f9f89a8cf3dafc7b07404220 Author: Algirdas Rascius Date: 2016-05-24T13:45:45Z Fixed CURATOR-329 - SharedValue.start() method does not update to current value if version of value currently stored in zookeeper is 0 ---- > SharedValue.start() method does not update to current value if version of value currently stored in zookeeper is 0 (zero) > ------------------------------------------------------------------------------------------------------------------------- > > Key: CURATOR-329 > URL: https://issues.apache.org/jira/browse/CURATOR-329 > Project: Apache Curator > Issue Type: Bug > Components: Recipes > Affects Versions: 2.10.0 > Reporter: Algirdas Rascius > Priority: Blocker > > When zookeeper node stores value with version 0 and SharedCount instance is created and started for this node, getCount() method returns seedValue passed to SharedCount constructor instead of actual value stored in zookeeper node. This only happens when zookeeper node version is 0 (zero). > For example: > {code} > // Node /count does not exists before the test > SharedCount count1 = new SharedCount(client, "/count", 10); > SharedCount count2 = new SharedCount(client, "/count", 20); > count1.start(); > count2.start(); > Assert.assertEquals(count1.getCount(), 10); > Assert.assertEquals(count2.getCount(), 10); // Should return 10, but returns 20 instead > {code} > Issue arrises because when constructed class SharedValue initializes instance variable currentValue with version 0 and does not update value in updateValue(..) method if version returned by zookeeper is 0. -- This message was sent by Atlassian JIRA (v6.3.4#6332)