@ Override public CompletableFuture < Void > onStop ( ) { log . info ( "Stopping the JobMaster for job {}({})." , jobGraph . getName ( ) , jobGraph . getJobID ( ) ) ; // disconnect from all registered TaskExecutors final Set < ResourceID > taskManagerResourceIds = new HashSet <> ( registeredTaskManagers . keySet ( ) ) ; final FlinkException cause = new FlinkException ( "Stopping JobMaster for job " + jobGraph . getName ( ) + ' ' + jobGraph . getJobID ( ) + ")." ) ; for ( ResourceID taskManagerResourceId : taskManagerResourceIds ) { disconnectTaskManager ( taskManagerResourceId , cause ) ; } taskManagerHeartbeatManager . stop ( ) ; resourceManagerHeartbeatManager . stop ( ) ; // make sure there is a graceful exit suspendExecution ( new FlinkException ( "JobManager is shutting down." ) ) ; // shut down will internally release all registered slots slotPool . close ( ) ; return CompletableFuture . completedFuture ( null ) ; }
Suspend the job and shutdown all other services including rpc .