sunxiaojian commented on code in PR #4683:
URL:
https://github.com/apache/incubator-seatunnel/pull/4683#discussion_r1191871004
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:
##########
@@ -455,6 +459,37 @@ private synchronized void updateMetricsContextInImap() {
contextMap.putAll(finishedExecutionContexts);
contextMap.putAll(executionContexts);
try {
+ ClusterState clusterState =
+
nodeEngine.getHazelcastInstance().getCluster().getClusterState();
+ if (clusterState != ClusterState.ACTIVE) {
+ logger.warning(
+ String.format(
+ "The cluster is not ready yet, cluster state
[%s], looking forward to the next "
+ + "scheduling",
+ clusterState));
+ return;
+ }
+ // Waiting for cluster startup to complete
+ if (waitClusterStarted == null) {
+ waitClusterStarted =
+ new CountDownLatch(
+
nodeEngine.getHazelcastInstance().getCluster().getMembers().size());
+ nodeEngine
+ .getHazelcastInstance()
+ .getLifecycleService()
+ .addLifecycleListener(
+ event -> {
+ if (event.getState() ==
LifecycleEvent.LifecycleState.STARTED) {
+ waitClusterStarted.countDown();
+ }
+ });
+ }
+ if (waitClusterStarted.getCount() > 0) {
+ logger.warning(
+ "The cluster is not ready yet, looking forward to the
next scheduling");
+ return;
+ }
+
Review Comment:
@ic4y PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]