Bug 61322 - Http11Processor.disableKeepAlivePercentage not work after code change in 60319
Summary: Http11Processor.disableKeepAlivePercentage not work after code change in 60319
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 7.0.79
Hardware: PC Linux
: P2 critical (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2017-07-21 08:54 UTC by Colin
Modified: 2017-07-24 13:50 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Colin 2017-07-21 08:54:36 UTC
After code change in 60319, connector attributes will be reported as -1 when an Executor is in use.

But in Http11Processor.disableKeepAlive(), we still use endpoint.getMaxThreads() to get max threads allowed, and when use a Executor, this returns -1, and disableKeepAlive() always return false in this case.

This issue exist from 7.0.73 to 7.0.79.

Comment 1 Colin 2017-07-21 08:59:14 UTC
I found this issue in some of my customer environment, our application use 200 threads, and some customer have more than 300 clients, so about 100+ client can't connect to server.

After some check, I found all thread blocked on keep-alive state and trying to read next request from socket.
Comment 2 Colin 2017-07-21 09:13:24 UTC
Another issue I found:
With below server configuration:
<Executor name="tomcatThreadPool" namePrefix="http-exec-" maxThreads="4" minSpareThreads="2"/>
<Connector executor="tomcatThreadPool"  maxThreads="2" />

From document of Connector.executor, if I use Executor in Connector(so not use internalExecutor), maxThreads and other thread pool related properties will ignored(so return -1), but I found Connector's service thread count still limited by Connector.maxThreads.
e.g. in above example, the executor has 4 threads, but in my test, only 2 clients connected and both keep alived and no more client can connect.

Please also help to check this issue. I use 7.0.75 in my tests.
Comment 3 Mark Thomas 2017-07-24 13:50:25 UTC
Thanks for the report.

Both issues are fixed in:
- 8.0.x for 8.0.46 onwards
- 7.0.x for 7.0.80 onwards

Note since this affects the BIO connector, it does not apply to 8.5.x onwards.