apache/dolphinscheduler · error · RegistryException

Cannot connect to jdbc registry due to interrupted exception

Error message

Cannot connect to jdbc registry due to interrupted exception

What it means

Thrown in JdbcRegistry.connectUntilTimeout when the Thread.sleep between connectivity probes is interrupted: another thread interrupted this startup thread while it was waiting to retry the JDBC registry connection. The interrupt flag is restored before throwing, so cancellation is honored.

Source

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

    }

    @Override
    public void connectUntilTimeout(@NonNull Duration timeout) throws RegistryException {
        long beginTimeMillis = System.currentTimeMillis();
        long endTimeMills = timeout.getSeconds() <= 0 ? Long.MAX_VALUE : beginTimeMillis + timeout.toMillis();
        while (true) {
            if (System.currentTimeMillis() > endTimeMills) {
                throw new RegistryException(
                        String.format("Cannot connect to jdbc registry in %s s", timeout.getSeconds()));
            }
            if (jdbcRegistryClient.isConnectivity()) {
                return;
            }
            try {
                Thread.sleep(jdbcRegistryProperties.getHeartbeatRefreshInterval().toMillis());
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RegistryException("Cannot connect to jdbc registry due to interrupted exception", e);
            }
        }
    }

    @Override
    public void subscribe(String watchedPath, SubscribeListener listener) {
        checkNotNull(watchedPath);
        checkNotNull(listener);
        jdbcRegistryClient
                .subscribeJdbcRegistryDataChange(new JdbcRegistryDataChangeListenerAdapter(watchedPath, listener));
    }

    @Override
    public void addConnectionStateListener(ConnectionListener listener) {
        checkNotNull(listener);
        jdbcRegistryClient.subscribeConnectionStateChange(new ConnectionStateListener() {

            @Override

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Find what interrupted the connecting thread (shutdown hook, executor shutdown, watchdog) in the logs
  2. If this happens during normal shutdown it is expected; during startup, check for premature lifecycle termination
  3. Avoid interrupting registry-connect threads unless canceling startup intentionally
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java:92 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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