hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Lipcon (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7607) Simplify the RPC proxy cleanup process
Date Mon, 05 Sep 2011 18:42:11 GMT

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

Todd Lipcon commented on HADOOP-7607:
-------------------------------------

- I think LOG.error is probably more appropriate if called on a non-proxy
- The stopProxy code doesn't deal with ClassCastException. I think it might be better like:
{code}
InvocationHandler handler = Proxy.getInvocationHandler(proxy);
if (handler instanceof Closeable) {
  ((Closeable)handler).close();
} else {
  warn
}
{code}
what do you think?
- the javadoc indicates IAE is thrown but you catch it, like you said
- it seems odd that you maintain backwards-compat in terms of not throwing IAE for non-proxy
objects, but you now throw IOE where the old version didn't. I think we should either maintain
complete back-compat (catch and warn on either exception) or ditch that and just throw both
exceptions. I'm leaning towards the catch-and-warn route since RPC.stopProxy is probably used
in some finally{} clauses where adding a new exception could break error recovery paths unless
we're careful

> Simplify the RPC proxy cleanup process
> --------------------------------------
>
>                 Key: HADOOP-7607
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7607
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: ipc
>    Affects Versions: 0.24.0
>            Reporter: Aaron T. Myers
>            Assignee: Aaron T. Myers
>             Fix For: 0.24.0
>
>         Attachments: hadoop-7607.0.patch
>
>
> The process to clean up an RPC proxy object is to call RPC.stopProxy, which looks up
the RPCEngine previously associated with the interface which that proxy object provides and
calls RPCEngine.stopProxy passing in the proxy object. Every concrete implementation of RPCEngine.stopProxy
then looks up the invocation handler associated with the proxy object and calls close() on
that invocation handler.
> This process can be simplified by cutting out the steps of looking up the previously-registered
RPCEngine, and instead just having RPC.stopProxy directly look up the invocation handler for
the proxy object and call close() on it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message