{"record":{"id":"fabbd2f0a21a6d75","repo":"apache/seatunnel","slug":"can-not-get-coordinator-service-from-an-active-mas","errorCode":null,"errorMessage":"Can not get coordinator service from an active master node.","messagePattern":"Can not get coordinator service from an active master node\\.","errorType":"exception","errorClass":"SeaTunnelEngineRetryableException","httpStatus":null,"severity":"warning","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java","lineNumber":313,"sourceCode":"                try {\n                    LOGGER.warning(\n                            \"This is master node, waiting the coordinator service init finished\");\n                    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();","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java#L295-L331","documentation":"SeaTunnelServer.getCoordinatorService throws SeaTunnelEngineRetryableException when the node IS the master but its CoordinatorService is not active yet (coordinator still initializing after becoming master). The comment in the source states this is intentional: throwing a retryable exception releases the operation thread so the worker can retry the operation later.","triggerScenarios":"Worker operations (task deployment, state updates, resource manager calls) arriving at the newly elected master while it is still initializing its CoordinatorService after failover or cluster startup.","commonSituations":"Master node crash followed by election; large cluster where coordinator activation (restoring jobs) takes seconds; burst of worker operations hitting the master immediately after it takes over.","solutions":["No manual fix needed: it's a retryable exception and the worker's operation retry loop will re-execute once the coordinator becomes active.","If retries exhaust, increase the operation retry budget/check interval on workers or shorten coordinator startup time (reduce job restore load).","Verify master election works properly — check Hazelcast logs if the coordinator never becomes active."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (SeaTunnelEngineRetryableException e) {\n    // coordinator not ready yet on master — safe to retry\n    Uninterruptibles.sleepUninterruptibly(Constant.OPERATION_RETRY_SLEEP, TimeUnit.MILLISECONDS);\n    return retryOp();\n}","preventionTips":["This is expected right after master election — always wrap coordinator calls in retry logic","Give the new master time to activate its coordinator before submitting jobs","Reduce job restore workload to shorten the coordinator activation window"],"tags":["seatunnel","zeta-engine","retryable","failover","coordinator"],"backgroundTag":"request-timeout","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"}