{"record":{"id":"ea0a64933d033b53","repo":"apache/dolphinscheduler","slug":"zookeeper-release-lock-error","errorCode":null,"errorMessage":"zookeeper release lock error","messagePattern":"zookeeper release 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":284,"sourceCode":"        Map<String, InterProcessMutex> processMutexMap = threadLocalLockMap.get();\n        if (processMutexMap == null) {\n            return true;\n        }\n        InterProcessMutex interProcessMutex = processMutexMap.get(key);\n        if (null == interProcessMutex) {\n            return false;\n        }\n        try {\n            interProcessMutex.release();\n            if (interProcessMutex.isOwnedByCurrentThread()) {\n                return true;\n            }\n            processMutexMap.remove(key);\n            if (processMutexMap.isEmpty()) {\n                threadLocalLockMap.remove();\n            }\n        } catch (Exception e) {\n            throw new RegistryException(\"zookeeper release lock error\", e);\n        }\n        return true;\n    }\n\n    @Override\n    public boolean isConnected() {\n        return client.getZookeeperClient().isConnected();\n    }\n\n    @Override\n    public void close() {\n        treeCacheMap.values().forEach(CloseableUtils::closeQuietly);\n        CloseableUtils.closeQuietly(client);\n    }\n}\n","sourceCodeStart":266,"sourceCodeEnd":300,"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#L266-L300","documentation":"Wrapper thrown in ZookeeperRegistry.releaseLock: when InterProcessMutex.release fails or the mutex remains owned by the current thread after release (abnormal state) the exception path wraps any error into a RegistryException('zookeeper release lock error'). It fires on ZK connection problems or lock-state corruption, not on balanced normal releases.","triggerScenarios":"Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the cause: ConnectionLoss/SessionExpired point to ZK connectivity; IllegalMonitorStateException points to releasing a lock not held by this thread","Ensure acquire/release pairs execute on the same thread","Check for session expiry killing the lock ephemeral nodes mid-release","Retry or treat as recoverable — the lock will expire with the session"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}