[
https://issues.apache.org/jira/browse/KNOX-2912?focusedWorklogId=865222&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-865222
]
ASF GitHub Bot logged work on KNOX-2912:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jun/23 13:09
Start Date: 13/Jun/23 13:09
Worklog Time Spent: 10m
Work Description: moresandeep commented on code in PR #763:
URL: https://github.com/apache/knox/pull/763#discussion_r1228104881
##########
gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/ConfigurableHADispatch.java:
##########
@@ -220,7 +220,7 @@ protected void executeRequest(HttpUriRequest
outboundRequest, HttpServletRequest
} catch ( IOException e ) {
/* if non-idempotent requests are not allowed to failover, unless it's a
connection error */
if(!isConnectionError(e.getCause()) &&
isNonIdempotentAndNonIdempotentFailoverDisabled(outboundRequest)) {
- LOG.cannotFailoverNonIdempotentRequest(outboundRequest.getMethod(),
e.toString());
+ LOG.cannotFailoverNonIdempotentRequest(outboundRequest.getMethod(),
e.getCause());
Review Comment:
In case cause is null this will throw NPE, e.toString() saves us from that.
##########
gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java:
##########
@@ -62,7 +62,7 @@ protected void executeRequest(HttpUriRequest outboundRequest,
HttpServletRequest
} catch (StandbyException | SafeModeException | IOException e) {
/* if non-idempotent requests are not allowed to failover */
if(!failoverNonIdempotentRequestEnabled &&
nonIdempotentRequests.stream().anyMatch(outboundRequest.getMethod()::equalsIgnoreCase))
{
- LOG.cannotFailoverNonIdempotentRequest(outboundRequest.getMethod(),
e.toString());
+ LOG.cannotFailoverNonIdempotentRequest(outboundRequest.getMethod(),
e.getCause());
Review Comment:
In case cause is null this will throw NPE, e.toString() saves us from that.
Issue Time Tracking
-------------------
Worklog Id: (was: 865222)
Time Spent: 40m (was: 0.5h)
> Don't fail over non idempotent requests unless it's a connect exception
> -----------------------------------------------------------------------
>
> Key: KNOX-2912
> URL: https://issues.apache.org/jira/browse/KNOX-2912
> Project: Apache Knox
> Issue Type: Task
> Reporter: Attila Magyar
> Assignee: Attila Magyar
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Currently knox tries to fail over non idempotent (POST/PUT/etc) requests.
> Failover should only happen if the request was not yet consumed, eg.: a
> connection related exception happened.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)