[
https://issues.apache.org/jira/browse/HADOOP-11295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14908492#comment-14908492
]
Xiao Chen commented on HADOOP-11295:
------------------------------------
Hi [~mingma] and [~jira.shegalov],
I was reading up this JIRA, and the fix in Server.java looks great. Thanks for
the contribution!
However, in the test case in the latest patch, IMO instead of checking:
{{
while (server.getCallQueueLen() != 1
&& countThreads(CallQueueManager.class.getName()) != 1
&& countThreads(TestProtocol.class.getName()) != 1) {
Thread.sleep(100);
}
}}
we should check:
{{
while (server.getCallQueueLen() != 1
|| countThreads(CallQueueManager.class.getName()) != 1
|| countThreads(TestProtocol.class.getName()) != 1) {
Thread.sleep(100);
}
}}
to guarantee that the threads are in expected states when we later call
{{server.stop()}}.
Also, it appears to me that the class name for the test protocol is
org.apache.hadoop.ipc.TestRPC$TestImpl, as we {{setInstance(new TestImpl())}}
when creating the server. So I suggest instead of checking
{{countThreads(TestProtocol.class.getName())}}, we can check
{{countThreads(TestImpl.class.getName())}}
Please let me know if this makes sense to you. Thanks.
> RPC Server Reader thread can't shutdown if RPCCallQueue is full
> ---------------------------------------------------------------
>
> Key: HADOOP-11295
> URL: https://issues.apache.org/jira/browse/HADOOP-11295
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Ming Ma
> Assignee: Ming Ma
> Labels: 2.6.1-candidate
> Fix For: 2.6.1, 2.7.0
>
> Attachments: HADOOP-11295-2.patch, HADOOP-11295-3.patch,
> HADOOP-11295-4.patch, HADOOP-11295-5.patch, HADOOP-11295.006.patch,
> HADOOP-11295.branch-2.6.patch, HADOOP-11295.patch
>
>
> If RPC server is asked to stop when RPCCallQueue is full, {{reader.join()}}
> will just wait there. That is because
> 1. The reader thread is blocked on {{callQueue.put(call);}}.
> 2. When RPC server is asked to stop, it will interrupt all handler threads
> and thus no threads will drain the callQueue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)