[
https://issues.apache.org/jira/browse/HADOOP-9691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Nauroth updated HADOOP-9691:
----------------------------------
Attachment: HADOOP-9691.1.patch
Attaching a patch to switch to using {{AtomicInteger}}. I've also added a test
that makes RPC calls from multiple threads sharing the same client instance and
then checks that every call had a unique call ID in the expected sequential
range. This test shows the same results before and after the switch to
{{AtomicInteger}}.
To support the test, I needed to add a {{getCallId}} method to the server to
expose call ID from the current call in its thread-local storage. I assume
we'll eventually need this method anyway for HDFS-4942 when we start attaching
client ID + call ID to edit log ops.
> RPC clients can generate call ID using AtomicInteger instead of synchronizing
> on the Client instance.
> -----------------------------------------------------------------------------------------------------
>
> Key: HADOOP-9691
> URL: https://issues.apache.org/jira/browse/HADOOP-9691
> Project: Hadoop Common
> Issue Type: Improvement
> Components: ipc
> Affects Versions: 3.0.0, 2.1.0-beta
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
> Priority: Minor
> Attachments: HADOOP-9691.1.patch
>
>
> As noted in discussion on HADOOP-9688, we can optimize generation of call ID
> in the RPC client code. Currently, it synchronizes on the {{Client}}
> instance to coordinate access to a shared {{int}}. We can switch this to
> {{AtomicInteger}} to avoid lock contention.
--
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