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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/AbstractHandler.java
##########
@@ -116,7 +117,15 @@ protected void respondAsLeader(ChannelHandlerContext ctx, 
RoutedRequest routedRe
 
                FileUploads uploadedFiles = null;
                try {
-                       inFlightRequestTracker.registerRequest();
+                       synchronized (this) {
+                               if (terminationFuture != null) {

Review comment:
       I think I have given you ill-advice here @Tartarus0zm and @zentol. Since 
we want to support asynchronous operations such as cancel-with-savepoint which 
only shuts down the cluster (per-job-mode) if the result has been served, it is 
a valid state that `terminationFuture` is non null and we still want to process 
the request.
   
   What I would suggest is to change this line into `if (terminationFuture != 
null && terminationFuture.isDone()) {`. Moreover, all `inFlightRequestTracker` 
modifying calls should happen under `this` lock.




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