[
https://issues.apache.org/jira/browse/KNOX-1414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16630984#comment-16630984
]
Kristopher Kane commented on KNOX-1414:
---------------------------------------
The reason why I think DefaultHaDispatch is used is because of the way the
exception was vs should have been handled - in addition to the logging I
presented.
I happened upon this problem when writing a Java client for WebHDFS. I
accidentally asked to create the same file twice. The second time should have
bubbled up a "FileAlreadyExistsException," (HTTP 403 in the WebHDFS World)
instead I got Socket Timeout at the client. Digging in, I found that
WebHdfsHaDispatch looks like it should handle that and bubble up the pointed
exception to me, but, DefaultHaDispatch doesn't handle that granularity of
String parsing of the JSON response like WebHdfsHaDispatch does.
> DefaultHaDispatch is used by WEBHDFS instead of WebHdfsHaDispatch
> -----------------------------------------------------------------
>
> Key: KNOX-1414
> URL: https://issues.apache.org/jira/browse/KNOX-1414
> Project: Apache Knox
> Issue Type: Bug
> Affects Versions: 0.12.0
> Reporter: Kristopher Kane
> Priority: Minor
>
> Here is the series of failover attempts with DefaultHaDispatch (vs the
> WebHDFS one) when 403 is hit:
>
>
> {noformat}
> Caused by: java.io.IOException: java.io.IOException: Service connectivity
> error.
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.failoverRequest(DefaultHaDispatch.java:125)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.executeRequest(DefaultHaDispatch.java:94)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.failoverRequest(DefaultHaDispatch.java:119)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.executeRequest(DefaultHaDispatch.java:94)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.failoverRequest(DefaultHaDispatch.java:119)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.executeRequest(DefaultHaDispatch.java:94)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.failoverRequest(DefaultHaDispatch.java:119)
> at
> org.apache.hadoop.gateway.ha.dispatch.DefaultHaDispatch.executeRequest(DefaultHaDispatch.java:94)
> {noformat}
> But `data/services/webhdfs/2.4.0->service.xml` has:
>
> <dispatch
> classname="org.apache.hadoop.gateway.hdfs.dispatch.HdfsHttpClientDispatch"
> ha-classname="org.apache.hadoop.gateway.hdfs.dispatch.WebHdfsHaDispatch"/>
>
> Which should use WebHdfsHaDispatch.
>
> Both HA dispatch classes conduct HA failover/retry but WebHdfsHaDispatch is
> only slightly more context aware. Both could appear to work in 2/3rds of the
> cases (1/3rd being when the NN is in Safemode which is not handled
> specifically by the default dispatch) and you would not know
> WebHdfsHaDispatch was not being used unless you looked at gateway.log
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)