HADOOP-13244. o.a.h.ipc.Server#Server should honor handlerCount when queueSizePerHandler is specified in consturctor. Contributed by Kai Sasaki.
(cherry picked from commit 20b13d109a
)
This commit is contained in:
parent
06b76f1586
commit
9c66fffe4a
|
@ -2469,7 +2469,7 @@ public abstract class Server {
|
|||
this.maxDataLength = conf.getInt(CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,
|
||||
CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);
|
||||
if (queueSizePerHandler != -1) {
|
||||
this.maxQueueSize = queueSizePerHandler;
|
||||
this.maxQueueSize = handlerCount * queueSizePerHandler;
|
||||
} else {
|
||||
this.maxQueueSize = handlerCount * conf.getInt(
|
||||
CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
|
||||
|
|
|
@ -348,6 +348,10 @@ public class TestRPC extends TestRpcBase {
|
|||
|
||||
assertEquals(3, server.getNumReaders());
|
||||
assertEquals(200, server.getMaxQueueSize());
|
||||
|
||||
server = newServerBuilder(conf).setQueueSizePerHandler(10)
|
||||
.setNumHandlers(2).setVerbose(false).build();
|
||||
assertEquals(2 * 10, server.getMaxQueueSize());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue