Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/3709
  
    @WangTaoTheTonic Doesn't matter that the job status is ever changing, we 
only care about the state at the time of the request.
    
    There are 2 cases to consider when accessing the cache for a given ID:
    
    **a) An EG was cached for the given ID**
    
    In this case we can check the state of the job via 
`AccessExceutionGraph#getState`. Modify the this block in `ExecutionGraphHolder`
    
    ```
    if (cached != null) {
        return cached;
    }
    ```
    to this
    ```
    if (cached != null) {
        if (cached.getState() == JobStatus.SUSPENDED) {
                cache.remove(jid);
        }
        return cached;
    }
    ```
    and you're done.
    
    **b) No EG was cached for the given ID**
    
    In this case the status doesn't matter, you ask the JM and if it returns an 
EG you add it to the cache. We don't care whether this EG is suspended because 
it will be removed with the next request that comes in.


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