[
https://issues.apache.org/jira/browse/HBASE-20611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499660#comment-16499660
]
Chia-Ping Tsai commented on HBASE-20611:
----------------------------------------
[~xucang] Thanks for picking this up.
{code:java}
- for (CallRunner cr:queue) {
+ while (!queue.isEmpty()) {
+ CallRunner cr = queue.poll();{code}
The #poll will remove the element from the queue. It means that the call runner
will be removed even if the runner haven't been executed. Could we implement
the iterator method for BoundedPriorityBlockingQueue and
AdaptiveLifoCoDelCallQueue (pardon me, I don't study
BoundedPriorityBlockingQueue and AdaptiveLifoCoDelCallQueue). BTW, seems the
test doesn't cover the path of this issue. Perhaps we can call the
#getCallQueueInfo to ensure this bug have been fixed. Also, it would be better
to cover both blocking queue impl. thanks!
> UnsupportedOperationException may thrown when calling getCallQueueInfo()
> ------------------------------------------------------------------------
>
> Key: HBASE-20611
> URL: https://issues.apache.org/jira/browse/HBASE-20611
> Project: HBase
> Issue Type: Bug
> Affects Versions: 2.0.0
> Reporter: Allan Yang
> Assignee: Xu Cang
> Priority: Major
> Attachments: HBASE-20611.master.001.patch,
> HBASE-20611.master.002.patch
>
>
> HBASE-16290 added a new feature to dump queue info, the method
> getCallQueueInfo() need to iterate the queue to get the elements in the
> queue. But, except the Java's LinkedBlockingQueue, the other queue
> implementations like BoundedPriorityBlockingQueue and
> AdaptiveLifoCoDelCallQueue don't implement the method iterator(). If those
> queues are used, a UnsupportedOperationException will be thrown.
> This can be easily be reproduced by the UT testCallQueueInfo while adding a
> conf: conf.set("hbase.ipc.server.callqueue.type", "deadline")
> {code}
> java.lang.UnsupportedOperationException
> at
> org.apache.hadoop.hbase.util.BoundedPriorityBlockingQueue.iterator(BoundedPriorityBlockingQueue.java:285)
> at
> org.apache.hadoop.hbase.ipc.RpcExecutor.getCallQueueCountsSummary(RpcExecutor.java:166)
> at
> org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.getCallQueueInfo(SimpleRpcScheduler.java:241)
> at
> org.apache.hadoop.hbase.ipc.TestSimpleRpcScheduler.testCallQueueInfo(TestSimpleRpcScheduler.java:164)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)