Uploaded image for project: 'Apache Twill (Retired)'
  1. Apache Twill (Retired)
  2. TWILL-141

ZKClient created through ZKClients.namespace fails in create call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.2.0-incubating, 0.1.0-incubating, 0.3.0-incubating, 0.5.0-incubating, 0.4.1-incubating, 0.6.0-incubating
    • 0.7.0-incubating
    • zookeeper
    • None

    Description

      For a ZKClient created through ZKClients.namespace, calling create on "/" will fail with an exception "java.lang.IllegalArgumentException: Path must not end with / character". For non-namespaced ZKClient, it either succeeds or having the `NodeExistsException` exception if the root path already exist.

      This is the code snippet for reproducing the issue:

      ZKClient zk = ZKClients.namespace(zkClient, "/test");
      zk.create("/", null, CreateMode.PERSISTENT).get();
      

      and this is the stacktrace:

      java.lang.IllegalArgumentException: Path must not end with / character
      	at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:58)
      	at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:35)
      	at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:803)
      	at org.apache.twill.internal.zookeeper.DefaultZKClientService.doCreate(DefaultZKClientService.java:147)
      	at org.apache.twill.internal.zookeeper.DefaultZKClientService.create(DefaultZKClientService.java:137)
      	at org.apache.twill.zookeeper.ForwardingZKClient.create(ForwardingZKClient.java:61)
      	at org.apache.twill.internal.zookeeper.FailureRetryZKClient.create(FailureRetryZKClient.java:70)
      	at org.apache.twill.zookeeper.ForwardingZKClient.create(ForwardingZKClient.java:61)
      	at org.apache.twill.zookeeper.ZKClientServices$1.create(ZKClientServices.java:84)
      	at org.apache.twill.internal.zookeeper.NamespaceZKClient.create(NamespaceZKClient.java:73)
      	at org.apache.twill.zookeeper.AbstractZKClient.create(AbstractZKClient.java:42)
      	at org.apache.twill.zookeeper.AbstractZKClient.create(AbstractZKClient.java:36)
      

      Attachments

        Activity

          People

            chtyim Terence Yim
            chtyim Terence Yim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: