rmetzger opened a new pull request #15577: URL: https://github.com/apache/flink/pull/15577
## What is the purpose of the change - Exceptions during the initialization (thrown by the JobMaster) were not forwarded to the user. This is now guarded by the JobMasterITCase.testJobManagerInitializationExceptionsAreForwardedToTheUser(). - The initialization of the JobMaster (including the scheduler initialization, which runs the source coordinators and other user code) was executed in the JobManager main thread, potentially blocking the JobManager in case of blocking calls in the JobMaster init. **Open TODOs**: (due to the amount of changes, and the time spend on the issue already, I'd like to get some initial feedback on the change) - The problem that the JobMaster initialization was executed in the main thread executor was not, and is still not guarded by a test. - The newly introduced `JobMasterITCase.testJobManagerInitializationExceptionsAreForwardedToTheUser()` is not nice: It relies on an implementation detail. ## Brief change log - Introduced `JobManagerStatusListener` to JobManagerRunner - Reworked the `DispatcherJob` to track the initialization based on the signals from the `JobManagerStatusListener`. - Introduced a `DispatcherJobStatus` class with tracks the status along with the JobManagerRunner future (they are updated together, thus we track them in one class) - Adjusted the DispatcherTests because initialization completion is now dependent on getting leadership. ## Verifying this change Added some tests, adjusted some. -- 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]
