You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2019/11/08 19:03:14 UTC

[GitHub] [knox] jameschen1519 commented on a change in pull request #177: [WIP] KNOX-2095 - Adding in DefaultDispatch code and tests to handle 504 errors

jameschen1519 commented on a change in pull request #177: [WIP] KNOX-2095 - Adding in DefaultDispatch code and tests to handle 504 errors
URL: https://github.com/apache/knox/pull/177#discussion_r344322230
 
 

 ##########
 File path: gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/DefaultDispatch.java
 ##########
 @@ -138,6 +144,10 @@ protected HttpResponse executeOutboundRequest( HttpUriRequest outboundRequest )
         }
       }
       auditor.audit( Action.DISPATCH, outboundRequest.getURI().toString(), ResourceType.URI, ActionOutcome.SUCCESS, RES.responseStatus( statusCode ) );
+    } catch( SocketTimeoutException e ) {
+        //Set a 504 instead of throwing an IO exception in the event of a socket timeout,
+        //as an IO exception forces a 500 to be displayed.
 
 Review comment:
   Thanks for the feedback. I'll add in the audit and log lines, but just to confirm, when does a socket timeout usually occur? So far all of the socket timeouts that have occurred to me have been caused artificially by lowering the socketTimeout parameter (so I don't have any information on this), but I've been told that if a socket timeout occurs on one node, it is likely to occur on other nodes. Are there situations in which this isn't the case?

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


With regards,
Apache Git Services