[ https://issues.apache.org/jira/browse/TEZ-4394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
László Bodor updated TEZ-4394: ------------------------------ Summary: Netty4 ShuffleHandler: should use 1 boss thread (was: Netty4 ShuffleHandler: use 1 boss thread) > Netty4 ShuffleHandler: should use 1 boss thread > ----------------------------------------------- > > Key: TEZ-4394 > URL: https://issues.apache.org/jira/browse/TEZ-4394 > Project: Apache Tez > Issue Type: Bug > Reporter: László Bodor > Priority: Major > > https://github.com/apache/tez/commit/01847814d32aac6b77a6810ea25d6780fb94b257#diff-5c5dffcaf349fe521937812b49849c59fba3e67fc53d74fb990b7e0ef7ff5e59R182 > {code} > bossGroup = new NioEventLoopGroup(maxShuffleThreads, new ThreadFactory() { > @Override > public Thread newThread(Runnable r) { > return new Thread(r, BOSS_THREAD_NAME_PREFIX + > bossThreadCounter.incrementAndGet()); > } > }); > {code} > With netty3, we initialized NioServerSocketChannelFactory with below > constructor: > {code} > selector = new NioServerSocketChannelFactory( > Executors.newCachedThreadPool(bossFactory), > Executors.newCachedThreadPool(workerFactory), > maxShuffleThreads); > {code} > this always creates 1 boss and n maxShuffleThreads threads: > {code} > public NioServerSocketChannelFactory( > Executor bossExecutor, Executor workerExecutor, > int workerCount) { > this(bossExecutor, 1, workerExecutor, workerCount); > } > {code} > In Nio model, bossThread take care all bounded socket(listen socket), > workerThread take care Accepted-socket (included IO and call event method > such as messageReceived). > In case of the boss thread pool, actually the thread pool is unneeded because > current implementation acquires only a single thread from it. That thread > sleeps on the selector for server socket most of the time, after accepting > connection that connection is registered with a worker. From that moment on > worker is responsible for serving that connection. -- This message was sent by Atlassian Jira (v8.20.1#820001)