{"record":{"id":"497878925a3233f6","repo":"apache/dolphinscheduler","slug":"zookeeper-get-lock-s-error","errorCode":null,"errorMessage":"zookeeper get lock: %s error","messagePattern":"zookeeper get lock: (.+?) error","errorType":"exception","errorClass":"RegistryException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java","lineNumber":229,"sourceCode":"    public boolean acquireLock(String key) {\n        Map<String, InterProcessMutex> processMutexMap = threadLocalLockMap.get();\n        if (null == processMutexMap) {\n            processMutexMap = new HashMap<>();\n            threadLocalLockMap.set(processMutexMap);\n        }\n        InterProcessMutex interProcessMutex = null;\n        try {\n            interProcessMutex =\n                    Optional.ofNullable(processMutexMap.get(key)).orElse(new InterProcessMutex(client, key));\n            interProcessMutex.acquire();\n            processMutexMap.put(key, interProcessMutex);\n            return true;\n        } catch (Exception e) {\n            try {\n                if (interProcessMutex != null) {\n                    interProcessMutex.release();\n                }\n                throw new RegistryException(String.format(\"zookeeper get lock: %s error\", key), e);\n            } catch (Exception exception) {\n                throw new RegistryException(String.format(\"zookeeper get lock: %s error\", key), e);\n            }\n        }\n    }\n\n    @Override\n    public boolean acquireLock(String key, long timeout) {\n        Map<String, InterProcessMutex> processMutexMap = threadLocalLockMap.get();\n        if (null == processMutexMap) {\n            processMutexMap = new HashMap<>();\n            threadLocalLockMap.set(processMutexMap);\n        }\n        InterProcessMutex interProcessMutex = null;\n        try {\n            interProcessMutex =\n                    Optional.ofNullable(processMutexMap.get(key)).orElse(new InterProcessMutex(client, key));\n            if (interProcessMutex.acquire(timeout, MILLISECONDS)) {","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java#L211-L247","documentation":"Wrapper thrown in ZookeeperRegistry.acquireLock: when Curator's InterProcessMutex.acquire fails — connection loss, session expired, or interrupt while waiting for the distributed mutex on the key — the code attempts to release the partially-acquired mutex and throws a RegistryException naming the lock key. It indicates the thread did NOT obtain the lock.","triggerScenarios":"Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check ZooKeeper health/session stability if the cause is ConnectionLoss or SessionExpired","If the cause is InterruptedException, review who interrupted the waiting thread","Retry acquisition; verify no stale lock holders block the path","Confirm the lock path scheme matches what other processes use"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}