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 02:59:02 UTC

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

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

 ##########
 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:
   So we need an audit and log line here just like the generic `Exception` catch block. 
   
   The other thing we need to do is make sure this doesn't break the HA case. There a failover needs to happen.

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