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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/AbstractHandler.java
##########
@@ -117,13 +117,10 @@ protected void respondAsLeader(ChannelHandlerContext ctx, 
RoutedRequest routedRe
 
                FileUploads uploadedFiles = null;
                try {
-                       synchronized (this) {
-                               if (terminationFuture != null) {
-                                       log.debug("The handler instance for {} 
had already been closed.", 
untypedResponseMessageHeaders.getTargetRestEndpointURL());
-                                       ctx.channel().close();
-                                       return;
-                               }
-                               inFlightRequestTracker.registerRequest();
+                       if (!inFlightRequestTracker.registerRequest()) {

Review comment:
       So this works because the final unregister happens when the 
closeHandlerAsync future completes, which does so once the async operation was 
accessed from the `completedOperationsCache`?




----------------------------------------------------------------
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]


Reply via email to