{"record":{"id":"3932ee220eb4aa14","repo":"apache/dolphinscheduler","slug":"cannot-connect-to-jdbc-registry-due-to-interrupted","errorCode":null,"errorMessage":"Cannot connect to jdbc registry due to interrupted exception","messagePattern":"Cannot connect to jdbc registry due to interrupted exception","errorType":"exception","errorClass":"RegistryException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java","lineNumber":92,"sourceCode":"    }\n\n    @Override\n    public void connectUntilTimeout(@NonNull Duration timeout) throws RegistryException {\n        long beginTimeMillis = System.currentTimeMillis();\n        long endTimeMills = timeout.getSeconds() <= 0 ? Long.MAX_VALUE : beginTimeMillis + timeout.toMillis();\n        while (true) {\n            if (System.currentTimeMillis() > endTimeMills) {\n                throw new RegistryException(\n                        String.format(\"Cannot connect to jdbc registry in %s s\", timeout.getSeconds()));\n            }\n            if (jdbcRegistryClient.isConnectivity()) {\n                return;\n            }\n            try {\n                Thread.sleep(jdbcRegistryProperties.getHeartbeatRefreshInterval().toMillis());\n            } catch (InterruptedException e) {\n                Thread.currentThread().interrupt();\n                throw new RegistryException(\"Cannot connect to jdbc registry due to interrupted exception\", e);\n            }\n        }\n    }\n\n    @Override\n    public void subscribe(String watchedPath, SubscribeListener listener) {\n        checkNotNull(watchedPath);\n        checkNotNull(listener);\n        jdbcRegistryClient\n                .subscribeJdbcRegistryDataChange(new JdbcRegistryDataChangeListenerAdapter(watchedPath, listener));\n    }\n\n    @Override\n    public void addConnectionStateListener(ConnectionListener listener) {\n        checkNotNull(listener);\n        jdbcRegistryClient.subscribeConnectionStateChange(new ConnectionStateListener() {\n\n            @Override","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java#L74-L110","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Find what interrupted the connecting thread (shutdown hook, executor shutdown, watchdog) in the logs","If this happens during normal shutdown it is expected; during startup, check for premature lifecycle termination","Avoid interrupting registry-connect threads unless canceling startup intentionally"],"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"}