hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13546) Override equals and hashCode to avoid connection leakage
Date Mon, 29 Aug 2016 18:12:22 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15446617#comment-15446617

Jing Zhao commented on HADOOP-13546:

Thanks for the work, Xiaobing. Some comments:
# No need to add the new {{tryOnceThenFail}} method which is only used by unit tests.
# Any reason TestConnectionRetryPolicy needs to extend TestRpcBase? 
# Looks like this unit test should be moved to o.a.h.io.retry package.
# In WrapperRetryPolicy, the semantic of {{equals}} and {{hashCode}} does not consider remoteExceptionToRetry.
Maybe you can add some java comment to explain why.
# WrapperRetryPolicy's constructor does not need to be public.
# In the following code, let's also check if remoteExceptionToRetry is null.
      } else if (e instanceof RemoteException) {
        final RemoteException re = (RemoteException)e;
        p = remoteExceptionToRetry.equals(re.getClassName())?
            multipleLinearRandomRetry: RetryPolicies.TRY_ONCE_THEN_FAIL;
# In the unit test, a lot of assertEquals(true/false, x.equals(y)) can be replaced by assertEquals(x,
y) or assertNotEquals(x, y).
# "testAnonymousRetryPolicy..." should be "testDefaultRetryPolicy..."
# We can pass a RetryPolicy[] to {{verifyRetryPolicyEquivalence}} and use a simple "for" loop
to compare each pair of retry policies.
# Let's also add some new unit tests to test cases when we call {{RetryUtils.getDefaultRetryPolicy}}
but providing different configurations (to enable to disable retry policy) and specifications
(of multipleLinearRandomRetry).

> Override equals and hashCode to avoid connection leakage
> --------------------------------------------------------
>                 Key: HADOOP-13546
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13546
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: ipc
>    Affects Versions: 2.7.0
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>         Attachments: HADOOP-13546-HADOOP-13436.000.patch, HADOOP-13546-HADOOP-13436.001.patch,
HADOOP-13546-HADOOP-13436.002.patch, HADOOP-13546-HADOOP-13436.003.patch
> Override #equals and #hashcode to ensure multiple instances are equivalent. They eventually
> share the same RPC connection given the other arguments of constructing ConnectionId
> the same.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message