diff --git a/seatunnel-engine/seatunnel-engine-client/src/test/java/org/apache/seatunnel/engine/client/SeaTunnelClientTest.java b/seatunnel-engine/seatunnel-engine-client/src/test/java/org/apache/seatunnel/engine/client/SeaTunnelClientTest.java index 1510e7727f7..d7e55db4ec2 100644 --- a/seatunnel-engine/seatunnel-engine-client/src/test/java/org/apache/seatunnel/engine/client/SeaTunnelClientTest.java +++ b/seatunnel-engine/seatunnel-engine-client/src/test/java/org/apache/seatunnel/engine/client/SeaTunnelClientTest.java @@ -392,11 +392,14 @@ public void testSetJobIdDuplicate() { Assertions.assertThrows( Exception.class, () -> jobExecutionEnvWithSameJobId.execute().waitForJobCompleteV2()); - Assertions.assertEquals( - String.format( - "The job id %s has already been submitted and is not starting with a savepoint.", - jobId), - exception.getCause().getMessage()); + Assertions.assertTrue( + exception + .getCause() + .getMessage() + .contains( + String.format( + "The job id %s has already been submitted and is not starting with a savepoint.", + jobId))); } catch (Exception e) { throw new RuntimeException(e); } finally { diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java index 765869fd030..b76af4c19a0 100644 --- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java +++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java @@ -84,6 +84,12 @@ public SeaTunnelServer(@NonNull SeaTunnelConfig seaTunnelConfig) { /** Lazy load for Slot Service */ public SlotService getSlotService() { + // If the node is master node, the slot service is not needed. + if (EngineConfig.ClusterRole.MASTER.ordinal() + == seaTunnelConfig.getEngineConfig().getClusterRole().ordinal()) { + return null; + } + if (slotService == null) { synchronized (this) { if (slotService == null) { diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/AbstractResourceManager.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/AbstractResourceManager.java index b830e5f0563..6c04748ccca 100644 --- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/AbstractResourceManager.java +++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/AbstractResourceManager.java @@ -74,25 +74,31 @@ public void init() { private void initWorker() { log.info("initWorker... "); - List
aliveWorker = + List aliveNode = nodeEngine.getClusterService().getMembers().stream() - .filter(Member::isLiteMember) .map(Member::getAddress) .collect(Collectors.toList()); - log.info("initWorker live nodes: " + aliveWorker); + log.info("init live nodes: {}", aliveNode); List