You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/07/21 03:59:50 UTC

[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5082: [WIP][KYUUBI #5080][FLINK] Fix EmbeddedExecutorFactory not thread-safe during bootstrap

pan3793 commented on code in PR #5082:
URL: https://github.com/apache/kyuubi/pull/5082#discussion_r1270201931


##########
externals/kyuubi-flink-sql-engine/src/main/java/org/apache/flink/client/deployment/application/executors/EmbeddedExecutorFactory.java:
##########
@@ -105,6 +114,25 @@ public boolean isCompatibleWith(final Configuration configuration) {
   public PipelineExecutor getExecutor(final Configuration configuration) {
     checkNotNull(configuration);
     Collection<JobID> executorJobIDs;
+    synchronized (bootstrapLock) {
+      // wait in a loop to avoid spurious wakeups
+      int retry = 0;
+      while (bootstrapJobIds == null && retry < BOOTSTRAP_WAIT_RETRIES) {
+        try {
+          bootstrapLock.wait(BOOTSTRAP_WAIT_INTERVAL);
+          retry++;
+        } catch (InterruptedException e) {
+          throw new RuntimeException("Interrupted while waiting for bootstrap.", e);
+        }
+      }
+      if (bootstrapJobIds == null) {
+        throw new RuntimeException(
+            "Bootstrap of Flink SQL engine timed out after "
+                + BOOTSTRAP_WAIT_INTERVAL * BOOTSTRAP_WAIT_RETRIES
+                + ". "
+                + "Please check the engine log for more details.");

Review Comment:
   ```suggestion
                   + ". Please check the engine log for more details.");
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org