turcsanyip commented on a change in pull request #5419:
URL: https://github.com/apache/nifi/pull/5419#discussion_r718662407



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
##########
@@ -413,12 +414,20 @@ protected void proceedFlow(final HttpServletRequest 
request, final HttpServletRe
                     new Object[]{flowFileSet, request.getRemoteHost(), 
request.getRemotePort(), foundSubject, foundIssuer, flowFileSet.size(), uuid});
             }
         } else {
-            response.setStatus(this.returnCode);
             logger.info("Received from Remote Host: [{}] Port [{}] SubjectDN 
[{}] IssuerDN [{}]; transferring to 'success'",
                 new Object[]{request.getRemoteHost(), request.getRemotePort(), 
foundSubject, foundIssuer});
 
             session.transfer(flowFileSet, ListenHTTP.RELATIONSHIP_SUCCESS);
-            session.commitAsync();
+
+            final AsyncContext asyncContext = request.startAsync();
+            session.commitAsync(() -> {
+                        response.setStatus(this.returnCode);
+                        asyncContext.complete();
+                    }, t -> {
+                        
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);

Review comment:
       @exceptionfactory Added the error logging. Thanks!




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to