apache/dolphinscheduler · error · RegistryException

Zookeeper registry start failed

Error message

Zookeeper registry start failed

What it means

Thrown by ZookeeperRegistry.start() when the thread waiting for the ZooKeeper connection is interrupted (InterruptedException). The interrupt flag is re-set before throwing. It means startup was aborted by an external interruption (e.g. shutdown) rather than a connection failure.

Source

Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java:116

    }

    @Override
    public void start() {
        final StopWatch stopWatch = StopWatch.createStarted();
        client.start();
        try {
            if (!client.blockUntilConnected(DurationUtils.toMillisInt(properties.getBlockUntilConnected()),
                    MILLISECONDS)) {
                client.close();
                throw new RegistryException(
                        "zookeeper connect failed to: " + properties.getConnectString() + " in : "
                                + properties.getBlockUntilConnected().toMillis() + "ms");
            }
            stopWatch.stop();
            log.info("ZookeeperRegistry started at: {}/ms", stopWatch.getTime());
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RegistryException("Zookeeper registry start failed", e);
        }
    }

    @Override
    public void addConnectionStateListener(ConnectionListener listener) {
        client.getConnectionStateListenable().addListener(new ZookeeperConnectionStateListener(listener));
    }

    @Override
    public void connectUntilTimeout(@NonNull Duration timeout) throws RegistryException {
        try {
            if (!client.blockUntilConnected(DurationUtils.toMillisInt(timeout), MILLISECONDS)) {
                throw new RegistryException(
                        String.format("Cannot connect to registry in %s s", timeout.getSeconds()));
            }
        } catch (RegistryException e) {
            throw e;
        } catch (InterruptedException e) {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check whether the application was shutting down when start() ran; if so this is expected
  2. Avoid running start() on threads that get interrupted by other components; start the registry before beginning shutdown
  3. Ensure startup code preserves the interrupt status and exits cleanly instead of retrying
  4. If interruption comes from a watchdog, increase its startup timeout

Example fix

// before
registry.start();
// after
try {
    registry.start();
} catch (RegistryException e) {
    if (Thread.currentThread().isInterrupted()) {
        log.info("Registry startup interrupted, aborting");
        return;
    }
    throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.currentThread().isInterrupted()) {
    throw new IllegalStateException("Skipping registry start: thread already interrupted");
}

Try / catch

try {
    registry.start();
} catch (RegistryException e) {
    if (Thread.currentThread().isInterrupted()) {
        log.info("Registry start interrupted (likely shutdown); aborting");
        return;
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling start() while the executing thread receives Thread.interrupt() — typically application shutdown, executor termination, or a caller cancelling startup.

Common situations: Service stopped mid-startup; JVM shutdown hooks; thread pools shutting down while registry init runs; timeouts in orchestrators that interrupt long-running init threads.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


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