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
- Inspect the cause exception for the real failure
- Verify DB connectivity
- Check for stale lock rows in the lock table and clean them up
- 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
- Prefer the timeout variant to bound waiting
- Periodically clean stale lock rows
- Monitor DB connection health
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
- key: not exist
- Get key: %s error
- put key:%s, value:%s error
- Delete key: %s error
- Get key: %s children error
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/e77bd65cec1e0de0.
Report an issue: GitHub.