{"record":{"id":"2cf4158a92404c29","repo":"apache/seatunnel","slug":"please-don-t-get-coordinator-service-from-an-inact","errorCode":null,"errorMessage":"Please don't get coordinator service from an inactive master node","messagePattern":"Please don't get coordinator service from an inactive master node","errorType":"exception","errorClass":"SeaTunnelEngineException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java","lineNumber":316,"sourceCode":"                    Thread.sleep(retryPause);\n                    retryCount++;\n                } catch (InterruptedException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n            if (coordinatorService.isCoordinatorActive()) {\n                return coordinatorService;\n            }\n\n            if (!isMasterNode()) {\n                throw new SeaTunnelEngineException(\"This is not a master node now.\");\n            }\n            // Return retryable exception to retry from the worker node, because the coordinator is\n            // not ready yet. By this way, we can release the operation thread and retry later.\n            throw new SeaTunnelEngineRetryableException(\n                    \"Can not get coordinator service from an active master node.\");\n        } else {\n            throw new SeaTunnelEngineException(\n                    \"Please don't get coordinator service from an inactive master node\");\n        }\n    }\n\n    public RealtimeMetricsService getRealtimeMetricsService() {\n        return realtimeMetricsService;\n    }\n\n    synchronized void startRealtimeMetricsService(CoordinatorService activeCoordinatorService) {\n        if (realtimeMetricsService != null) {\n            return;\n        }\n        realtimeMetricsService =\n                new RealtimeMetricsService((NodeEngineImpl) nodeEngine, activeCoordinatorService);\n        realtimeMetricsService.start();\n    }\n\n    synchronized void stopRealtimeMetricsService() {","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java#L298-L334","documentation":"SeaTunnelServer.getCoordinatorService throws SeaTunnelEngineException (\"Please don't get coordinator service from an inactive master node\") when the node is the master but requests the coordinator service with an inactive coordinator and the pre-existing active check was bypassed — i.e. fetching the coordinator from a master node whose coordinator service is inactive. It signals calling the getter in a state where the coordinator cannot serve the request.","triggerScenarios":"Calling getCoordinatorService on a master node after the coordinator service was deactivated (shutdown in progress, node demotion, initialization failure) rather than through the guarded active-coordinator path.","commonSituations":"Operations racing with cluster/node shutdown; coordinator activation failed on the master (check earlier logs for initialization errors); internal callers after membership change.","solutions":["Check master logs for CoordinatorService initialization/deactivation errors; restart the node or cluster if the coordinator failed to activate.","Retry the operation against the current master (resolve topology via Hazelcast) rather than a cached member reference.","If triggered during shutdown, it's expected — stop issuing jobs/operations during node teardown."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// only call when master and coordinator are active\nif (seaTunnelServer.isMasterNode() && seaTunnelServer.getCoordinatorService().isCoordinatorActive()) { ... }","typeGuard":null,"tryCatchPattern":"try {\n    CoordinatorService cs = seaTunnelServer.getCoordinatorService();\n} catch (SeaTunnelEngineException e) {\n    if (e.getMessage().contains(\"inactive master node\")) {\n        log.warn(\"Coordinator inactive on master; skipping operation or re-resolving master\");\n    } else throw e;\n}","preventionTips":["Check isCoordinatorActive() before issuing coordinator-scoped operations","Do not issue jobs/operations during node or cluster shutdown","Investigate coordinator activation failures in master logs if this appears outside shutdown"],"tags":["seatunnel","zeta-engine","coordinator","master-node"],"backgroundTag":"invalid-state-transition","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}