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

    https://github.com/apache/flink/pull/979#discussion_r36169003
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java 
---
    @@ -59,11 +87,50 @@ public JobClientActor(
                this.leaderSessionID = 
Preconditions.checkNotNull(leaderSessionID, "The leader session ID option must 
not be null.");
     
                this.sysoutUpdates = sysoutUpdates;
    +           // set this to -1 to indicate the job hasn't been created yet.
    +           this.currentJobCreatedAt = -1;
        }
        
        @Override
        protected void handleMessage(Object message) {
                
    +           // ======= Job status messages on regular intervals 
==============
    +           if(message instanceof JobManagerMessages.CurrentJobStatus){
    +                   JobStatus statusReport = 
((JobManagerMessages.CurrentJobStatus) message).status();
    +                   long timeDiff;
    +                   switch(statusReport){
    +                           case RUNNING:
    +                                   // Vincent, we happy?
    +                                   this.currentJobCreatedAt = -1;
    +                                   break;
    +                           case FINISHED:
    +                                   // Yeah! We happy!
    +                                   this.currentJobCreatedAt = -1;
    +                                   break;
    +                           case CREATED:
    +                                   // we're still at Job CREATED. Let's 
see if we're over the limit.
    +                                   timeDiff = (System.currentTimeMillis() 
- this.currentJobCreatedAt);
    +                                   if(timeDiff > 
JOB_CLIENT_JOB_STATUS_TIMEOUT){
    +                                           failWithTimeout(timeDiff);
    +                                   } // otherwise just wait a bit longer.
    +                                   break;
    +                           case RESTARTING:
    +                                   if(this.currentJobCreatedAt == -1){
    +                                           // we effectively have 
re-created the job
    +                                           this.currentJobCreatedAt = 
System.currentTimeMillis();
    +                                   } else{
    +                                           // it was already at either 
CREATED or RESTARTING. See if we're over the limit.
    +                                           timeDiff = 
(System.currentTimeMillis() - this.currentJobCreatedAt);
    +                                           if(timeDiff > 
JOB_CLIENT_JOB_STATUS_TIMEOUT){
    +                                                   
failWithTimeout(timeDiff);
    +                                           } // otherwise let's wait a bit 
more.
    +                                   }
    +                                   break;
    +                           default:
    +                                   // well, canceled or failed. We'll find 
out with an exact message in a while.
    --- End diff --
    
    What if the FAILING state is blocking for example?


---
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