Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4A3E10518 for ; Mon, 12 Jan 2015 23:05:33 +0000 (UTC) Received: (qmail 2889 invoked by uid 500); 12 Jan 2015 23:05:35 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 2844 invoked by uid 500); 12 Jan 2015 23:05:35 -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 2829 invoked by uid 99); 12 Jan 2015 23:05:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2015 23:05:35 +0000 Date: Mon, 12 Jan 2015 23:05:35 +0000 (UTC) From: "Cameron McKenzie (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CURATOR-179) Sequential path creation of /somepath/N throws exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Cameron McKenzie closed CURATOR-179. ------------------------------------ Resolution: Fixed Fix Version/s: 2.7.1 > Sequential path creation of /somepath/N throws exception > -------------------------------------------------------- > > Key: CURATOR-179 > URL: https://issues.apache.org/jira/browse/CURATOR-179 > Project: Apache Curator > Issue Type: Bug > Components: Framework > Affects Versions: 2.7.0 > Reporter: Ryan Luecke > Fix For: 2.7.1 > > > A new error is thrown when attempting to run one of our scala services with Curator 2.7.0. The error does not throw in 2.6.0 (or in 2.5.0, which is when the original code was written. We were updating to 2.7.0). > Stack trace: > [error] Exception in thread "main" java.lang.IllegalArgumentException: Path must not end with / character > [error] at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:61) > [error] at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:44) > [error] at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82) > [error] at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:589) > [error] at org.apache.curator.framework.imps.CreateBuilderImpl$1.forPath(CreateBuilderImpl.java:112) > [error] at org.apache.curator.framework.imps.CreateBuilderImpl$1.forPath(CreateBuilderImpl.java:76) > [error] at com.box..scala:175) > ... > This happens when we try to create node /somepath/N (where N is sequential zk node). > In Curator, PathUtils.validatePath has two signatures: > 1. public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException { > validatePath(isSequential? path + "1": path); > } > 2. public static String validatePath(String path) throws IllegalArgumentException { > ... > throws if path ends in '/' > ... > } > In our case, path /somepath/ does end in '/' > The way #1 calls #2 appears to be a hack (appending "1" to path in order to validate). This would have caused path validation to *succeed* for our case - however, the caller MUST call this #1 signature of validatePath. The code calls actually calls #2 instead. > 2.5.0 released May 28, 2014 > 2.6.0 released July 11, 2014 > * issue introduced > 2.7.0 released November 3, 2014 > I believe the issue was introduced on July 29 2014, when a call to #2 above was added to fixForNamespace(String namespace, String path) in > https://github.com/apache/curator/commit/96d2a55a03f8d0357f8f8cfa80a39a095d70667c > We've decided to workaround the issue at the moment. Our workaround is straightforward: > Change our sequential node path from /somepath/N > to /somepath/entry_N > Please get in touch if you need additional information to solve this issue. Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)