Bug 57936 - Wrong handling of acceptorThreadCount
Summary: Wrong handling of acceptorThreadCount
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-19 14:24 UTC by Oliver Kant
Modified: 2015-05-20 07:31 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kant 2015-05-19 14:24:07 UTC
According to https://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java there is a statement saying that if the acceptorThreadCount is 0, it is being set to 1 since NIO2 does not allow any form of IO concurrency.

Setting the acceptorThreadCount to 2 in server.xml will throw an error ("Socket accept failed"). Wouldn't it be better to change the code

        // Initialize thread count defaults for acceptor, poller
        if (acceptorThreadCount == 0) {
            // NIO2 does not allow any form of IO concurrency
            acceptorThreadCount = 1;
        }

into

        // Initialize thread count defaults for acceptor, poller
        if (acceptorThreadCount != 1) {
            // NIO2 does not allow any form of IO concurrency
            acceptorThreadCount = 1;
        }

to avoid this behaviour?

Thanks,
Oliver
Comment 1 Remy Maucherat 2015-05-20 07:31:43 UTC
This looks like a good idea, and it will be included in 8.0.24.