Where exactly did you add your own log message?

WebMonitorEndpoint.closeAsync() already logs on it's own whether the shutdown future was completed; meaning that it shouldn't have been necessary to add a separate log message. If you now only see the one you added, chances are that it was added at the wrong place.

On 3/24/2021 5:06 AM, 刘建刚 wrote:
      I am using flink 1.10.0. My perJob can not be cancelled. From the log I find that webMonitorEndpoint.closeAsync() is completed but deregisterApplication is not called. The related code is as follows:
public CompletableFuture<Void>deregisterApplicationAndClose(
       final ApplicationStatus applicationStatus, final @Nullable String 
diagnostics) {

    if (isRunning.compareAndSet(true, false)) {
       final CompletableFuture<Void> closeWebMonitorAndDeregisterAppFuture =
          FutureUtils.composeAfterwards(webMonitorEndpoint.closeAsync(), () ->
             deregisterApplication(applicationStatus, diagnostics, 
resourceManager.getJobId())); return 
FutureUtils.composeAfterwards(closeWebMonitorAndDeregisterAppFuture, 
this::closeAsyncInternal); }else {
       return terminationFuture; }
}
      For webMonitorEndpoint.closeAsync(), the code is as follows:
public CompletableFuture<Void>closeAsync() {
    synchronized (lock) {
       log.info("State is {}. Shutting down rest endpoint.", state); if (state 
== State.RUNNING) {
          final CompletableFuture<Void> shutDownFuture = 
FutureUtils.composeAfterwards(
             closeHandlersAsync(), this::shutDownInternal); 
shutDownFuture.whenComplete(
             (Void ignored, Throwable throwable) -> {
                log.info("Shut down complete."); if (throwable !=null) {
                   terminationFuture.completeExceptionally(throwable); }else {
                   terminationFuture.complete(null); }
             }); state = State.SHUTDOWN; }else if (state == State.CREATED) {
          terminationFuture.complete(null); state = State.SHUTDOWN; }

       return terminationFuture; }
}
      I am sure that it is completed with the log I added as follows:
image.png
     For deregisterApplication, I do not see any related log like "Shut down cluster because application is in {}, diagnostics {}.".
      Can anyone give me some suggestions? Thank you.


Reply via email to