apache/dolphinscheduler · error · RegistryException

Acquire lock: %s error

Error message

Acquire lock: %s error

What it means

Thrown by JdbcRegistry.acquireLock(key) when acquiring a non-blocking lock in the registry DB fails unexpectedly. RegistryExceptions raised by the client are rethrown as-is; all other exceptions are wrapped with the lock key.

Source

Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java:195

    @Override
    public boolean exists(String key) {
        try {
            return jdbcRegistryClient.existJdbcRegistryDataKey(key);
        } catch (Exception e) {
            throw new RegistryException(String.format("Check key: %s exist error", key), e);
        }
    }

    @Override
    public boolean acquireLock(String key) {
        try {
            jdbcRegistryClient.acquireJdbcRegistryLock(key);
            return true;
        } catch (RegistryException e) {
            throw e;
        } catch (Exception e) {
            throw new RegistryException(String.format("Acquire lock: %s error", key), e);
        }
    }

    @Override
    public boolean acquireLock(String key, long timeout) {
        try {
            return jdbcRegistryClient.acquireJdbcRegistryLock(key, timeout);
        } catch (RegistryException e) {
            throw e;
        } catch (Exception e) {
            throw new RegistryException(String.format("Acquire lock: %s error", key), e);
        }
    }

    @Override
    public boolean releaseLock(String key) {
        jdbcRegistryClient.releaseJdbcRegistryLock(key);
        return true;

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Inspect the cause exception for the real failure
  2. Verify DB connectivity
  3. Check for stale lock rows in the lock table and clean them up
  4. Use the timeout variant acquireLock(key, timeout) to bound waiting
Defensive patterns

Strategy: retry

Validate before calling

// verify lock table reachable: try (Connection c = dataSource.getConnection()) { }

Try / catch

try { got = registry.acquireLock(key); } catch (RegistryException e) { log.error("lock {} failed: {}", key, e.getCause(), e); got = false; }

Prevention

When it happens

Trigger: Calling registry.acquireLock(key) when the underlying DB lock row insert/update fails: connection error, constraint conflict, or transaction failure.

Common situations: DB outage, two nodes contending for the same lock with connection issues, expired/leaked lock rows blocking acquisition paths.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/e77bd65cec1e0de0. Report an issue: GitHub.