tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27513] New: - When ThreadPool is shutdown one idle thread is left behind
Date Mon, 08 Mar 2004 10:55:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27513>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27513

When ThreadPool is shutdown one idle thread is left behind

           Summary: When ThreadPool is shutdown one idle thread is left
                    behind
           Product: Tomcat 5
           Version: 5.0.19
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: sfzhi@yahoo.com


When org.apache.tomcat.util.threads.ThreadPool.shutdown() is called it
terminates all the idle threads except one (the last one that became idle). The
problem is that the mentioned method explicitly leaves that thread behind. That
can be easily seen (using a debugger) when tomcat is shutting down. In order to
solve the problem a very small correction is needed. In the mentioned method the
line:

    for(int i = 0 ; i < (currentThreadCount - currentThreadsBusy - 1) ; i++) {

should become:

    for(int i = 0 ; i < (currentThreadCount - currentThreadsBusy) ; i++) {

so that the loop would iterate over all the idle thread without exception.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message