Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1978#discussion_r63681528
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterClient.java ---
    @@ -211,14 +191,41 @@ public void run() {
                Runtime.getRuntime().addShutdownHook(clientShutdownHook);
     
                isConnected = true;
    +
    +           logAndSysout("Waiting until all TaskManagers have connected");
    +
    +           while(true) {
    +                   GetClusterStatusResponse status = getClusterStatus();
    +                   if (status != null) {
    +                           if (status.numRegisteredTaskManagers() < 
clusterDescriptor.getTaskManagerCount()) {
    +                                   logAndSysout("TaskManager status (" + 
status.numRegisteredTaskManagers() + "/"
    +                                           + 
clusterDescriptor.getTaskManagerCount() + ")");
    +                           } else {
    +                                   logAndSysout("All TaskManagers are 
connected");
    +                                   break;
    +                           }
    +                   } else {
    +                           logAndSysout("No status updates from the YARN 
cluster received so far. Waiting ...");
    +                   }
    +
    +                   try {
    +                           Thread.sleep(500);
    +                   }
    +                   catch (InterruptedException e) {
    +                           LOG.error("Interrupted while waiting for 
TaskManagers");
    +                           System.err.println("Thread is interrupted");
    +                           Thread.currentThread().interrupt();
    --- End diff --
    
    I guess I wrote this code. If I'm not mistaken, this means that the 
while(true) loop is not interruptable, right?
    I think we should change that and break out of the loop if it has been 
interrupted.
    
    What do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to