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

    https://github.com/apache/flink/pull/3982#discussion_r118497398
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java ---
    @@ -413,14 +413,18 @@ public static void 
runInteractiveCli(YarnClusterClient yarnCluster, boolean read
                        while (true) {
                                // ------------------ check if there are 
updates by the cluster -----------
     
    -                           GetClusterStatusResponse status = 
yarnCluster.getClusterStatus();
    -                           LOG.debug("Received status message: {}", 
status);
    +                           try {
    +                                   GetClusterStatusResponse status = 
yarnCluster.getClusterStatus();
    +                                   LOG.debug("Received status message: 
{}", status);
     
    -                           if (status != null && numTaskmanagers != 
status.numRegisteredTaskManagers()) {
    -                                   System.err.println("Number of connected 
TaskManagers changed to " +
    +                                   if (status != null && numTaskmanagers 
!= status.numRegisteredTaskManagers()) {
    +                                           System.err.println("Number of 
connected TaskManagers changed to " +
                                                        
status.numRegisteredTaskManagers() + ". " +
    -                                           "Slots available: " + 
status.totalNumberOfSlots());
    -                                   numTaskmanagers = 
status.numRegisteredTaskManagers();
    +                                                   "Slots available: " + 
status.totalNumberOfSlots());
    +                                           numTaskmanagers = 
status.numRegisteredTaskManagers();
    +                                   }
    +                           } catch (Exception e) {
    +                                   LOG.warn("Could not retrieve the 
current cluster status. Retrying...", e);
    --- End diff --
    
    "Skipping" might be a better term here, because we aren't actually retrying 
to get the cluster status, just ignoring it for this loop attempt.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to