Github user dragonsinth commented on a diff in the pull request:
https://github.com/apache/curator/pull/47#discussion_r18426992
--- Diff:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java
---
@@ -117,10 +117,8 @@ public void setValue(byte[] newValue) throws Exception
{
Preconditions.checkState(state.get() == State.STARTED, "not
started");
- VersionedValue<byte[]> localCopy = currentValue.get();
- client.setData().forPath(path, newValue);
-
- currentValue.set(new VersionedValue<byte[]>(localCopy.getVersion()
+ 1, Arrays.copyOf(newValue, newValue.length)));
+ Stat result = client.setData().forPath(path, newValue);
+ updateValue(result.getVersion(), Arrays.copyOf(newValue,
newValue.length));
--- End diff --
the oldVersion+1 thing seemed a little squirrelly to me
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---