[
https://issues.apache.org/jira/browse/FLUME-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167564#comment-14167564
]
Johny Rufus commented on FLUME-2409:
------------------------------------
It is indeed a bit hacky. The test case tries to connect to a invalid host and
when it fails in NettyAvroRpcClient, the client constructs a FlumeException
which uses the toString().
If the hostname lookup happens in toString(), and it crosses the timelimit for
the test, then we get a timeout related exception rather than FlumeException.
In this case, the testcase will fail due to timeout, which is valid. This is
the idea behind Roman's testcase.
But the default connection timeout is 20 seconds, and because of which using
the original testcase will always timeout. Hence I had to limit the connection
timeout to 1 sec and include it in the total timeout for the testcase (1 sec
will always be spent in trying to reconnect and 400 ms will be the allowed time
to make sure toString() doesnot use expensive hostname lookup)
> NettyAvroRpcClient performs unnecessary hostname lookups
> --------------------------------------------------------
>
> Key: FLUME-2409
> URL: https://issues.apache.org/jira/browse/FLUME-2409
> Project: Flume
> Issue Type: Bug
> Components: Client SDK
> Affects Versions: v1.5.0.1
> Reporter: Roman Novachenko
> Priority: Minor
> Fix For: v1.6.0
>
> Attachments: FLUME-2409-0.patch, FLUME-2409-1.patch, FLUME-2409.patch
>
>
> When NettyAvroRpcClient works with a host that has only an IP address
> associated with it but no hostname, some operations take too long (a few
> seconds vs expected millis). This affects most of exceptions throwing and a
> part of logging.
> This happens because of the unnecessary and expensive hostname lookup when
> converting NettyAvroRpcClient to String.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)