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 "Hadoop QA (JIRA)" <ji...@apache.org> on 2013/09/01 20:10:51 UTC
[jira] [Commented] (HADOOP-9916) Race condition in ipc.Client
causes TestIPC timeout
[ https://issues.apache.org/jira/browse/HADOOP-9916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755773#comment-13755773 ]
Hadoop QA commented on HADOOP-9916:
-----------------------------------
{color:green}+1 overall{color}. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12600999/HADOOP-9916.v1.patch
against trunk revision .
{color:green}+1 @author{color}. The patch does not contain any @author tags.
{color:green}+1 tests included{color}. The patch appears to include 1 new or modified test files.
{color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings.
{color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages.
{color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse.
{color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
{color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings.
{color:green}+1 core tests{color}. The patch passed unit tests in hadoop-common-project/hadoop-common.
{color:green}+1 contrib tests{color}. The patch passed contrib unit tests.
Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3049//testReport/
Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3049//console
This message is automatically generated.
> Race condition in ipc.Client causes TestIPC timeout
> ---------------------------------------------------
>
> Key: HADOOP-9916
> URL: https://issues.apache.org/jira/browse/HADOOP-9916
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Binglin Chang
> Assignee: Binglin Chang
> Priority: Minor
> Attachments: HADOOP-9916.v1.patch
>
>
> TestIPC timeouts occasionally, for example:
> [https://issues.apache.org/jira/browse/HDFS-5130?focusedCommentId=13749870&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13749870]
> [https://issues.apache.org/jira/browse/HADOOP-9915?focusedCommentId=13753302&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13753302]
> Look into the code, there is race condition in oah.ipc.Client, the race condition happen between RPC call thread and connection read response thread:
> {code}
> if (status == RpcStatusProto.SUCCESS) {
> Writable value = ReflectionUtils.newInstance(valueClass, conf);
> value.readFields(in); // read value
> call.setRpcResponse(value);
> calls.remove(callId);
> {code}
> Read Thread:
> Connection.receiveRpcResponse-> call.setRpcResponse(value) -> notify Call Thread
> Call Thread:
> Client.call -> Connection.addCall(retry with the same callId) -> notify read thread
> Read Thread:
> calls.remove(callId) # intend to remove old call, but removes newly added call...
> Connection.waitForWork end up wait maxIdleTime and close the connection. The call never get response and dead.
> The problem doesn't show because previously callId is unique, we never accidentally remove newly added calls, but when retry added this race condition became possible.
> To solve this, we can simply change order, remove the call first, then notify call thread.
> Note there are many places need this order change(normal case, error case, cleanup case)
> And there are some minor issues in TestIPC:
> 1. there are two method with same name:
> void testSerial()
> void testSerial(int handlerCount, boolean handlerSleep, ...)
> the second is not a test case(so should not use testXXX prefix), but somehow it causes testSerial(first one) run two times, see test report:
> {code}
> <testcase time="26.896" classname="org.apache.hadoop.ipc.TestIPC" name="testSerial"/>
> <testcase time="25.426" classname="org.apache.hadoop.ipc.TestIPC" name="testSerial"/>
> {code}
> 2. timeout annotation should be added, so next time related log is available.
--
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