[
https://issues.apache.org/jira/browse/HDFS-9905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241844#comment-15241844
]
Eric Payne commented on HDFS-9905:
----------------------------------
bq. java.net.SocksSocketImpl is possible to throw SocketTimeoutException with
null message. We seem not to be able to expect that SocketTimeoutException
always contains message such as "Read timed out" or "connect timed out".
bq. Use GenericTestUtils.assertExceptionContains instead of Assert.assertEquals
so that if the string doesn't match, it logs the exception.
Thanks, [~iwasakims] and [~jojochuang] for your work on this issue. I don't
know what would cause {{SocketTimeoutException}} to give a null message instead
of the expected {{Read timed out}}. However, your point about the original
stack trace being lost is a very good one:
bq. the exception object was reinterpreted in the exception handling, so the
original stack trace was lost.
In {{WebHdfsFileSystem#AbstractRunner#runWithRetry}}, the code that recreates
the exception with the node name should also propagate the stack trace:
{code}
ioe = ioe.getClass().getConstructor(String.class)
.newInstance(node + ": " + ioe.getMessage());
{code}
Should be:
{code}
IOException newIoe =
ioe.getClass().getConstructor(String.class)
.newInstance(node + ": " + ioe.getMessage());
newIoe.setStackTrace(ioe.getStackTrace());
ioe = newIoe;
{code}
I can open a separate JIRA for this if you want.
> TestWebHdfsTimeouts fails occasionally
> --------------------------------------
>
> Key: HDFS-9905
> URL: https://issues.apache.org/jira/browse/HDFS-9905
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: test
> Affects Versions: 2.7.3
> Reporter: Kihwal Lee
> Assignee: Wei-Chiu Chuang
> Attachments: HDFS-9905.001.patch
>
>
> When checking for a timeout, it does get {{SocketTimeoutException}}, but the
> message sometimes does not contain "connect timed out". Since the original
> exception is not logged, we do not know details.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)