[ https://issues.apache.org/jira/browse/HBASE-19942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16353647#comment-16353647 ]
Guanghao Zhang edited comment on HBASE-19942 at 2/6/18 1:31 PM: ---------------------------------------------------------------- The unit test hope start a rpc executor with 0 handler. But in RpcExecutor.java, the numCallQueues is at least 1, so the handler count is at least 1, too. And the default call queue type is fifo. So it will start a FastPathBalancedQueueRpcExecutor. If the handler was already start, then the callTask will be dispatch to the handler directly and no need add to queue. {code:java} SimpleRpcScheduler scheduler = new SimpleRpcScheduler(schedConf, 0, 0, 0, priority, HConstants.QOS_THRESHOLD); {code} {code:java} this.handlerCount = Math.max(handlerCount, this.numCallQueues); protected int computeNumCallQueues(final int handlerCount, final float callQueuesHandlersFactor) { return Math.max(1, Math.round(handlerCount * callQueuesHandlersFactor)); }{code} {code:java} public boolean dispatch(CallRunner callTask) throws InterruptedException { FastPathHandler handler = popReadyHandler(); return handler != null? handler.loadCallRunner(callTask): super.dispatch(callTask); }{code} was (Author: zghaobac): The unit test hope start a rpc executor with 0 handler. But in RpcExecutor.java, the numCallQueues is at least 1, so the handler count is at least 1, too. And the default call queue type is fifo. So it will start a FastPathBalancedQueueRpcExecutor. If the handler was already start, then the callTask will be dispatch to the handler directly and no need add to queue. {code} SimpleRpcScheduler scheduler = new SimpleRpcScheduler(schedConf, 0, 0, 0, priority, HConstants.QOS_THRESHOLD); {code} this.handlerCount = Math.max(handlerCount, this.numCallQueues); protected int computeNumCallQueues(final int handlerCount, final float callQueuesHandlersFactor) { return Math.max(1, Math.round(handlerCount * callQueuesHandlersFactor)); } {code} {code} public boolean dispatch(CallRunner callTask) throws InterruptedException { FastPathHandler handler = popReadyHandler(); return handler != null? handler.loadCallRunner(callTask): super.dispatch(callTask); } {code} > Fix flaky TestSimpleRpcScheduler > -------------------------------- > > Key: HBASE-19942 > URL: https://issues.apache.org/jira/browse/HBASE-19942 > Project: HBase > Issue Type: Sub-task > Reporter: Guanghao Zhang > Assignee: Guanghao Zhang > Priority: Major > Attachments: HBASE-19942.master.001.patch > > > [https://builds.apache.org/view/H-L/view/HBase/job/HBase-Find-Flaky-Tests-branch2.0/lastSuccessfulBuild/artifact/dashboard.html] > > https://builds.apache.org/job/HBASE-Flaky-Tests-branch2.0/1387/testReport/junit/org.apache.hadoop.hbase.ipc/TestSimpleRpcScheduler/testSoftAndHardQueueLimits/ > > h3. Stacktrace > java.lang.AssertionError at > org.apache.hadoop.hbase.ipc.TestSimpleRpcScheduler.testSoftAndHardQueueLimits(TestSimpleRpcScheduler.java:451) -- This message was sent by Atlassian JIRA (v7.6.3#76005)