Tartarus0zm commented on a change in pull request #13020:
URL: https://github.com/apache/flink/pull/13020#discussion_r462894771



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/AbstractHandler.java
##########
@@ -114,6 +115,21 @@ protected void respondAsLeader(ChannelHandlerContext ctx, 
RoutedRequest routedRe
                        log.trace("Received request " + httpRequest.uri() + 
'.');
                }
 
+               synchronized (this) {
+                       if (terminationFuture != null) {
+                               String errorMsg = "The handler instance for " + 
untypedResponseMessageHeaders.getTargetRestEndpointURL()
+                                       + " had already been closed";
+                               log.warn(errorMsg);
+                               HandlerUtils.sendErrorResponse(

Review comment:
       Do we still need to modify the processing logic of 
```requestProcessingFuture```? If we avoid NPE, the changes to 
```requestProcessingFuture``` may not be necessary.




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


Reply via email to