tillrohrmann edited a comment on issue #9832: [FLINK-11843] Bind lifespan of 
Dispatcher to leader session
URL: https://github.com/apache/flink/pull/9832#issuecomment-540651528
 
 
   > Since close async operation and modify job graph store operation both 
queued in main thread, even `Dispatcher` has been revoked leadership the 
previous modification wasn't cancelled. Said `DispatcherRunner` lost leadership 
and re-granted leadership without another leader occurred(e.g., ZK connection 
loss), it is possibly that the previous `Dispatcher` ran modification before it 
was terminated.
   
   I don't fully understand which interleaving of actions you mean @TisonKun. 
Do you mean that the `DispatcherRunner` loses leadership while the `Dispatcher` 
writes a `JobGraph` to the `JobGraphStore`? I think in this case, the shut down 
of the `Dispatcher` will wait until the `JobGraph` has been persisted, the 
corresponding `JobManagerRunner` has been shut down and the `JobGraph` has been 
released (however not removed). Conceptually, one can think that the leadership 
revocation just happened after the job submission.
   
   Or do you mean that we are waiting on a previous `JobManager` to terminate 
in order to execute `persistAndRunJob` and while we are waiting we lose the 
leadership? In that case, I think we need indeed check whether we are still 
running. If not, then we should not execute `action` in 
`waitForTerminatingJobManager`. I would actually consider this a follow up 
issue because it has been a problem before and there are different ways to go 
(checking `isRunning` vs. do not accept jobs with the same `JobID` while one 
`JobManagerRunner` is still shutting down.
   
   If you mean a different interleaving, then I would be helpful to describe it 
in more detail.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to