[
https://issues.apache.org/jira/browse/KNOX-2890?focusedWorklogId=852701&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-852701
]
ASF GitHub Bot logged work on KNOX-2890:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Mar/23 22:14
Start Date: 23/Mar/23 22:14
Worklog Time Spent: 10m
Work Description: pzampino commented on code in PR #742:
URL: https://github.com/apache/knox/pull/742#discussion_r1146931120
##########
gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java:
##########
@@ -59,33 +59,19 @@ protected void executeRequest(HttpUriRequest
outboundRequest, HttpServletRequest
try {
inboundResponse = executeOutboundRequest(outboundRequest);
writeOutboundResponse(outboundRequest, inboundRequest,
outboundResponse, inboundResponse);
- } catch (StandbyException e) {
+ } catch (StandbyException | SafeModeException | IOException e) {
/* if non-idempotent requests are not allowed to failover */
- if(!failoverNonIdempotentRequestEnabled &&
idempotentRequests.stream().anyMatch(outboundRequest.getMethod()::equalsIgnoreCase))
{
-
LOG.cannotFailoverToNonIdempotentRequest(outboundRequest.getMethod());
+ if(!failoverNonIdempotentRequestEnabled &&
nonIdempotentRequests.stream().anyMatch(outboundRequest.getMethod()::equalsIgnoreCase))
{
+ LOG.cannotFailoverNonIdempotentRequest(outboundRequest.getMethod(),
e.toString());
throw e;
} else {
- LOG.errorReceivedFromStandbyNode(e);
- failoverRequest(outboundRequest, inboundRequest, outboundResponse,
- inboundResponse, e);
- }
- } catch (SafeModeException e) {
- /* if non-idempotent requests are not allowed to failover */
- if(!failoverNonIdempotentRequestEnabled &&
idempotentRequests.stream().anyMatch(outboundRequest.getMethod()::equalsIgnoreCase))
{
-
LOG.cannotFailoverToNonIdempotentRequest(outboundRequest.getMethod());
- throw e;
- } else {
- LOG.errorReceivedFromSafeModeNode(e);
- failoverRequest(outboundRequest, inboundRequest, outboundResponse,
- inboundResponse, e);
- }
- } catch (IOException e) {
- /* if non-idempotent requests are not allowed to failover */
- if(!failoverNonIdempotentRequestEnabled &&
idempotentRequests.stream().anyMatch(outboundRequest.getMethod()::equalsIgnoreCase))
{
-
LOG.cannotFailoverToNonIdempotentRequest(outboundRequest.getMethod());
- throw e;
- } else {
- LOG.errorConnectingToServer(outboundRequest.getURI().toString(), e);
+ if(e instanceof StandbyException) {
Review Comment:
ok, must be the multiple commits confusing me.
Issue Time Tracking
-------------------
Worklog Id: (was: 852701)
Time Spent: 2.5h (was: 2h 20m)
> When client-knox connection is broken knox should not retry the same client
> request
> -----------------------------------------------------------------------------------
>
> Key: KNOX-2890
> URL: https://issues.apache.org/jira/browse/KNOX-2890
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 2.0..0
> Reporter: J.Andreina
> Assignee: Sandeep More
> Priority: Major
> Fix For: 2.1.0
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> Knox should not be retrying non idempotent requests like POST, PATCH etc.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)