[ https://issues.apache.org/jira/browse/HADOOP-6498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802708#action_12802708 ]
Ruyue Ma commented on HADOOP-6498: ---------------------------------- To: Hairong Unit test is very difficult. You can modify the code according to the following: {code:title=Client.java|borderStyle=solid} private void receiveResponse() { if (shouldCloseConnection.get()) { return; } touch(); try { int id = in.readInt(); if (LOG.isDebugEnabled()) LOG.debug(getName() + " got value #" + id); Call call = calls.remove(id); int state = in.readInt(); if (state == Status.SUCCESS.state) { Writable value = ReflectionUtils.newInstance(valueClass, conf); // < MODIFIED BY ME if (id == 100) { throw new IOException("network error"); } else { value.readFields(in); } // > MODIFIED BY ME call.setValue(value); } else if (state == Status.ERROR.state) { call.setException(new RemoteException(WritableUtils.readString(in), WritableUtils.readString(in))); } else if (state == Status.FATAL.state) { // Close the connection markClosed(new RemoteException(WritableUtils.readString(in), WritableUtils.readString(in))); } } catch (IOException e) { markClosed(e); } } {code} The 100th rpc call will hang. > IPC client bug may cause rpc call hang > --------------------------------------- > > Key: HADOOP-6498 > URL: https://issues.apache.org/jira/browse/HADOOP-6498 > Project: Hadoop Common > Issue Type: Bug > Components: ipc > Affects Versions: 0.18.3, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1 > Reporter: Ruyue Ma > Assignee: Ruyue Ma > Priority: Blocker > Fix For: 0.20.2, 0.21.0 > > Attachments: hadoop-6498-branch-0.20, hadoop-6498.patch > > > I can reproduce some rpc call hang bug when connection thread of ipc client > receives response for outstanding call. > The stacks when hang occurs (TaskTracker): > Waiting on org.apache.hadoop.ipc.client$c...@1c3cbb4b > Stack: > java.lang.Object.wait(Native Method) > java.lang.Object.wait(Object.java:485) > org.apache.hadoop.ipc.Client.call(Client.java:691) > org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:216) > org.apache.hadoop.mapred.$Proxy4.heartbeat(Unknown Source) > > org.apache.hadoop.mapred.TaskTracker.transmitHeartBeat(TaskTracker.java:1250) > org.apache.hadoop.mapred.TaskTracker.offerService(TaskTracker.java:1082) > org.apache.hadoop.mapred.TaskTracker.run(TaskTracker.java:1785) > org.apache.hadoop.mapred.TaskTracker.main(TaskTracker.java:2796) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.