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 2016/03/21 03:51:34 UTC
[Bug 59203] New: Try to call Thread.interrupt before calling
Thread.stop in WebappClassLoaderBase#clearReferencesThreads
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
Bug ID: 59203
Summary: Try to call Thread.interrupt before calling
Thread.stop in
WebappClassLoaderBase#clearReferencesThreads
Product: Tomcat 9
Version: 9.0.0.M4
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: huxing.zhang@gmail.com
Current behavior:
When undeploying an web app, tomcat first tries to check whether a container
thread is still handling request, if so, it will log a warning message.
Furthermore, if clearReferencesStopThreads is configured to be true, tomcat
will try to call Thread.stop to stop the thread in order to prevent memory
leak.
Our scenario:
We found that sometimes, a container thread is actually blocking an operation,
e.g. network I/O, but for some reasons, the operation is not returned for quite
a long time. I know that the best way should be application code to timeout for
such an operation. But I think tomcat can do sth. rather that log a warning
message.
Proposed behavior:
If configured, tomcat will call Thread.interrupt to force the blocking
operation return and container thread to proceed. Since application code may
continue to block on further operations, we can provide an option to let tomcat
call Thread.interrupt for several times. If that sill does not work, the final
defense is calling Thread.stop if configured.
Any interest on this proposal? If so, I can provide a patch on this.
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
Christopher Schultz <ch...@christopherschultz.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |Beginner
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
I like the idea in that interrupting a thread is a lot nicer than trying to
stop it.
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
--- Comment #3 from Govinda Sakhare <go...@gmail.com> ---
is it still up for grab?
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Thanks for the PR.
Fixed in:
- master for 10.0.0-M5 onwards
- 9.0.x for 9.0.35 onwards
- 8.5.x for 8.5.55 onwards
- 7.0.x for 7.0.104 onwards
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
--- Comment #2 from Huxing Zhang <hu...@gmail.com> ---
Thanks for showing your interest.
I will submit a patch later on.
--
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 59203] Try to call Thread.interrupt before calling Thread.stop
in WebappClassLoaderBase#clearReferencesThreads
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59203
--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
Looks like it's been ignored for 4 years. Go for it!
--
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