You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Todd Lipcon (Created) (JIRA)" <ji...@apache.org> on 2012/03/27 04:27:26 UTC

[jira] [Created] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

RPC.closeProxy shouldn't throw error when closing a mock
--------------------------------------------------------

                 Key: HADOOP-8218
                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
             Project: Hadoop Common
          Issue Type: Bug
          Components: ipc, test
    Affects Versions: 0.24.0
            Reporter: Todd Lipcon
            Assignee: Todd Lipcon
            Priority: Critical


HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240176#comment-13240176 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Common-0.23-Commit #735 (See [https://builds.apache.org/job/Hadoop-Common-0.23-Commit/735/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306160)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306160
Files : 
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240414#comment-13240414 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk #1033 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1033/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306164)

     Result = FAILURE
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306164
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240384#comment-13240384 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Hdfs-trunk #998 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/998/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306164)

     Result = FAILURE
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306164
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239191#comment-13239191 ] 

Hadoop QA commented on HADOOP-8218:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12520063/hadoop-8218.txt
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 11 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed unit tests in .

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/790//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/790//console

This message is automatically generated.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239171#comment-13239171 ] 

Todd Lipcon commented on HADOOP-8218:
-------------------------------------

bq. Todd, can the mock object implement a new interface that extends HAServiceProtocol and Closeable? Will that solve the problem?

That avoids the advanced syntax, but requires that you make such a fake interface everywhere you mock a protocol, which again is somewhat counter-intuitive.

bq. #2 makes the main code aware of test specifics, which isn't a good idea. How about doing #3 by creating a helper method that encapsulates that code in one place?

I was thinking about doing that... ie a MockitoUtils.mockIpcProtocol(FooProtocol.class). Since it seems people like this idea better than #2, I'll prepare such a patch.

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240204#comment-13240204 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk-Commit #1950 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1950/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306164)

     Result = ABORTED
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306164
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240177#comment-13240177 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #2012 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2012/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306164)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306164
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Suresh Srinivas (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239169#comment-13239169 ] 

Suresh Srinivas commented on HADOOP-8218:
-----------------------------------------

Todd, can the mock object implement a new interface that extends HAServiceProtocol and Closeable? Will that solve the problem?
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240203#comment-13240203 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Mapreduce-0.23-Commit #745 (See [https://builds.apache.org/job/Hadoop-Mapreduce-0.23-Commit/745/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306160)

     Result = ABORTED
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306160
Files : 
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240179#comment-13240179 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #1937 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1937/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306164)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306164
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239685#comment-13239685 ] 

Todd Lipcon commented on HADOOP-8218:
-------------------------------------

I'm fine with that, too. Suresh/Tom? Pick your patch, I'll do it. I just want to get something committed today to fix the failing tests.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Aaron T. Myers (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239682#comment-13239682 ] 

Aaron T. Myers commented on HADOOP-8218:
----------------------------------------

Here's another option I'd like to put forth:

Change back RPC.stopProxy to *not* throw an exception in the event the proxy or invocation handler doesn't implement Closeable. Add some tests that RPC.stopProxy does indeed correctly call close() on proxies or invocation handlers which do implement Closeable. This should ensure that RPC.stopProxy doesn't ever inadvertently regress so as to fail to stop a Closeable proxy, and still allows for mock objects to mock out IPC interfaces without having to jump through any hoops.

Thoughts?
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Suresh Srinivas (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240160#comment-13240160 ] 

Suresh Srinivas commented on HADOOP-8218:
-----------------------------------------

Aaron and Todd, I am not sure why making mock implement Closeable is that hard and deemed to be jumping through the hooops. There are only couple of instance of this. The problem associated with not implementing Closeable is typically caught while writing the unit test it self.

That said, if you guys feel it is such a pain, I am okay with Aaron is suggesting, in the interest of saving time. So I am +1 with what you guys choose, as long as we silently do not ignore failure to stop proxy, in non mock cases.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239157#comment-13239157 ] 

Hadoop QA commented on HADOOP-8218:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12520051/hadoop-8218.txt
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed these unit tests:
                  org.apache.hadoop.fs.viewfs.TestViewFsTrash

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/788//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/788//console

This message is automatically generated.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240162#comment-13240162 ] 

Todd Lipcon commented on HADOOP-8218:
-------------------------------------

Since the patch is up, and people seem OK with it, I'll commit the version Tom suggested (the latter patch)
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-8218:
--------------------------------

    Attachment: hadoop-8218.txt

Attached patch fixes the failing unit test. I'm not thrilled about the implementation but I think it's the least of the evils.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-8218:
--------------------------------

    Attachment: hadoop-8218.txt

This much bigger patch implements option #3 as Tom suggested.
It will also require a HDFS-side change to fix TestDFSHAAdmin which is currently failing.

So, I still think #2 is better, but you both think #3 is better, we'll go ahead with this, and I'll file a new HDFS JIRA to fix TestDFSHAAdmin to use the new mock util once this is committed.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Suresh Srinivas (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239601#comment-13239601 ] 

Suresh Srinivas commented on HADOOP-8218:
-----------------------------------------

Todd, I agree with Tom. The proxy must implement Closeable or have associated invoker with Closeable, is the new requirement. Without this, we were silently ignoring the failure to stop the proxy. The mocks also need to satisfy this requirement.

Thanks for doing a patch for option #3. +1 for the patch.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-8218:
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.24.0
                   0.23.3
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

Committed to 23.3 and trunk. I'll open an HDFS JIRA to fix the failing HDFS tests to use the new mock utility.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240175#comment-13240175 ] 

Hudson commented on HADOOP-8218:
--------------------------------

Integrated in Hadoop-Hdfs-0.23-Commit #725 (See [https://builds.apache.org/job/Hadoop-Hdfs-0.23-Commit/725/])
    HADOOP-8218. RPC.closeProxy shouldn't throw error when closing a mock. Contributed by Todd Lipcon. (Revision 1306160)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1306160
Files : 
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/TestFailoverController.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MockitoUtil.java

                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>             Fix For: 0.23.3, 0.24.0
>
>         Attachments: hadoop-8218.txt, hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-8218:
--------------------------------

    Status: Patch Available  (was: Open)
    
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by Arun C Murthy <ac...@hortonworks.com>.
Seems to me that we should fix tests to add Closeable rather than leak that into RPC.closeProxy.


[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Todd Lipcon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239121#comment-13239121 ] 

Todd Lipcon commented on HADOOP-8218:
-------------------------------------

I see three options:
1) Anywhere we call RPC.closeProxy, we check "if (foo instanceof Closeable) { ... } " first. But, that defeats the whole purpose of throwing the exception when we pass non-closeables, so we might as well just revert the behavior back to the original rather than does this.
2) In RPC.closeProxy, if the object doesn't implement Closeable, check if the proxy is a mock object. We can do this by looking for the string "EnhancerByMockitoWithCGLIB" in the class name. If we see that, pass through.
3) Anywhere we mock out an IPC protocol, we could use the syntax {{mock(FooProtocol.class, withSettings().extraInterfaces(Closeable.class));}}. I am not a fan of this, since it leaks the issue out to all of the test code, rather than localizing the workaround in the one place that matters. Plus, newer users of the mock framework won't know this advanced usage syntax (I had to google for a while to figure it out)

So, I plan to implement #2.
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8218) RPC.closeProxy shouldn't throw error when closing a mock

Posted by "Tom White (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239170#comment-13239170 ] 

Tom White commented on HADOOP-8218:
-----------------------------------

#2 makes the main code aware of test specifics, which isn't a good idea. How about doing #3 by creating a helper method that encapsulates that code in one place?
                
> RPC.closeProxy shouldn't throw error when closing a mock
> --------------------------------------------------------
>
>                 Key: HADOOP-8218
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8218
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ipc, test
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: hadoop-8218.txt
>
>
> HADOOP-8202 changed the behavior of RPC.stopProxy() to throw an exception if called on an object which doesn't implement Closeable. Unfortunately, we use mock objects in many test cases, and those mocks don't implement Closeable. This is causing TestZKFailoverController to fail in trunk, for example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira