tillrohrmann commented on a change in pull request #7346: [FLINK-11134][rest] 
Do not log stacktrace handled exceptions
URL: https://github.com/apache/flink/pull/7346#discussion_r245252896
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/AbstractHandler.java
 ##########
 @@ -160,28 +160,46 @@ protected void respondAsLeader(ChannelHandlerContext 
ctx, RoutedRequest routedRe
                        final FileUploads finalUploadedFiles = uploadedFiles;
                        requestProcessingFuture
                                .whenComplete((Void ignored, Throwable 
throwable) -> {
-                                       
inFlightRequestTracker.deregisterRequest();
-                                       cleanupFileUploads(finalUploadedFiles);
+                                       if (throwable != null) {
+                                               
handleException(ExceptionUtils.stripCompletionException(throwable), ctx, 
httpRequest);
+                                       }
+                                       
finalizeRequestProcessing(finalUploadedFiles);
 
 Review comment:
   We are slightly changing semantics here, because before we finalized the 
request processing after the error message has been sent. Now we send the error 
message and without waiting for the completion we finalize the request right 
away. One could change it to 
`requestProcessingFuture.exceptionally(handleException).thenCompose(Function.identity).whenComplete()`.
 But I think it should also be ok to finalize the request right away since we 
only send an error message and whether the error message arrives or the client 
connection is terminated via a `ConnectionException` should not matter too much.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to