You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/23 09:20:59 UTC

[GitHub] [flink] zentol commented on a change in pull request #14432: [FLINK-20678] Let JobManagerRunnerImpl fail if the JobMasterService fails unexpectedly

zentol commented on a change in pull request #14432:
URL: https://github.com/apache/flink/pull/14432#discussion_r547845925



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunnerImpl.java
##########
@@ -337,12 +337,25 @@ private void startJobMasterServiceSafely(UUID leaderSessionId) {
 		checkState(jobMasterService == null, "JobMasterService must be null before being started.");
 
 		try {
-			jobMasterService = jobMasterServiceFactory.createJobMasterService(
+			final JobMasterService newJobMasterService = jobMasterServiceFactory.createJobMasterService(
 				jobGraph,
 				new JobMasterId(leaderSessionId),
 				this,
 				userCodeClassLoader,
 				initializationTimestamp);
+
+			jobMasterService = newJobMasterService;
+
+			jobMasterService.getTerminationFuture().whenComplete((unused, throwable) -> {
+				if (throwable != null) {
+					synchronized (lock) {
+						// check that we are still running and the valid JobMasterService

Review comment:
       ```suggestion
   						// check that we are still running and JobMasterService is still valid
   ```




----------------------------------------------------------------
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:
users@infra.apache.org