You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2022/10/31 07:15:53 UTC

[Bug 66329] New: The Tomcat connection processing thread may exit abnormally

https://bz.apache.org/bugzilla/show_bug.cgi?id=66329

            Bug ID: 66329
           Summary: The Tomcat connection processing thread may exit
                    abnormally
           Product: Tomcat 8
           Version: 8.5.31
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: zhanyurui@sequoiadb.com
  Target Milestone: ----

Created attachment 38427
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38427&action=edit
A large number of connections enter close_wait

In tomcat org.apache.tomcat.util.net.NioEndpoint$Poller processKey method of
class, when in the process of selling Throwable handling, use ExpectionUtils.
The handleThrowable method handles the exception, and the ExpectionUtils after
capturing the Throwable process the logic as follows: When the Throwable
implementation class is ThreadDeath or VirtualMachineError, the clientPoller
thread exits by throwing an exception 
Our tomcat runs on linux and limits the maximum number of user threads. When
the number of threads reaches the upper limit, tomcat cannot create new
processing threads and throws OutOfMemoryError, which is a subclass of
VirtualMachineError. The clientPoller thread exits without closing connections
being processed. New requests come in and the Acceptor thread accepts requests.
In this case, a large number of connections are in the close_wait state without
clietPoller to process them

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66329] The Tomcat connection processing thread may exit abnormally

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66329

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
ThreadDeath should never happen since Thread.stop() is never called.

StackOverflowError should never happen as the code used by the Poller should
have significantly smaller stacks than web application code.

If VirtualMachineError happens then the Tomcat process needs to be stopped and
restarted anyway.

That the Tomcat process has been configured to operate with lower limits than
it requires to operate correctly is a configuration issue, not a Tomcat bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66329] The Tomcat connection processing thread may exit abnormally

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66329

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #2 from Remy Maucherat <re...@apache.org> ---
I was looking to see if we could do better, but it is likely to go into an
infinite loop. Ideally it would be good to keep the poller thread alive (only
this one) though ... Maybe hack in a Thread.sleep if
ExceptionUtils.handleThrowable throws an error ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org