[ https://issues.apache.org/jira/browse/HADOOP-9716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13707497#comment-13707497 ]
Suresh Srinivas commented on HADOOP-9716: ----------------------------------------- bq. BTW, since rpc retries use the same Call ID, we need to use Call ID and Retry # as a key to identify rpc calls. We need to change the protocol to support it. I have not looked at the patch deeply yet. Nicholas, currently the relationship is: {noformat} Proxy -> Invocation handler -> Invoker --(use new or existing)--> client --(use or reuse connection)--> Connection {noformat} All the above, in an RPC call happens in the context of a single thread. So if we had a ThreadLocal variable in a place such as Client (I prefer methods to generate call ID and setting call ID in the Client instead of Invocation handler as you have done), this could work as follows: # Invocation handler generates callID and stores it locally. It also sets it in a Thread local variable. CallID generation done this way cannot have sequential callID property per client as done today. It will have to be across all the clients. That is a change with this proposal. This is because Invoker apriori does not know the client it is going to use, due to the late binding of this at the invocation time. # Client picks it up from the ThreadLocal variable and uses it in RPC. # During retries, InvocationHandler sets the ThreadLocal callID with the information it has locally. # Client at the end of invocation clears the ThreadLocal callID. Wouldn't that work? > Move the Rpc request call ID generation to client side InvocationHandler > ------------------------------------------------------------------------ > > Key: HADOOP-9716 > URL: https://issues.apache.org/jira/browse/HADOOP-9716 > Project: Hadoop Common > Issue Type: Improvement > Components: ipc > Reporter: Suresh Srinivas > Assignee: Tsz Wo (Nicholas), SZE > Attachments: c9716_20130712b.patch, c9716_20130712.patch, > c9716_20130713.patch > > > Currently when RetryInvocationHandler is used to retry an RPC request, a new > RPC request call ID is generated. This jira proposes moving call ID > generation to InvocationHandler so that retried RPC requests retain the same > call ID. This is needed for RetryCache functionality proposed in HDFS-4942. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira