Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3782

ZookeeperDistributedLock can't acquir lock on windows because wrong Path

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • v2.6.0
    • v2.6.1
    • Storage - HBase
    • None

    Description

      In my windows env, when I run kylin, Kylin service can't start. In class ZookeeperDistributedLock, I found kylin use File(path).getCanonicalPath() to norm windows path, however this will get a path like ' C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock', for zookeeper,Path must start with / character.

      return new File(path).toURI().getPath() might be better!!!

      Below is stackTrace:

      Caused by: java.lang.IllegalStateException: Error while 832820@UC-20180829ZLJB trying to lock C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock
      at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:153)
      at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:170)
      at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lockJobEngine(ZookeeperDistributedLock.java:318)
      at org.apache.kylin.storage.hbase.util.ZookeeperJobLock.lockJobEngine(ZookeeperJobLock.java:81)
      at org.apache.kylin.job.impl.threadpool.DefaultScheduler.init(DefaultScheduler.java:152)
      at org.apache.kylin.rest.service.JobService.afterPropertiesSet(JobService.java:126)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      ... 60 more
      caused by: java.lang.IllegalArgumentException: Path must start with / character
      at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:54)
      at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:37)
      at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:63)
      at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82)
      at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:579)
      at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:434)
      at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
      at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:149)

      Attachments

        Issue Links

          Activity

            People

              aahi hailin.huang
              aahi hailin.huang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: