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 2014/05/05 23:10:01 UTC
[Bug 56492] New: Avoid eclipse debugger pausing on uncaught
exceptions when tomcat renews its threads
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
Bug ID: 56492
Summary: Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Product: Tomcat 8
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: slaurent@apache.org
Currently when tomcat is run with eclipse debugger and a Context is reloaded,
each thread that exits (because of the feature to renew threads) triggers a
breakpoint in eclipse if its "Suspend execution on uncaught exceptions" is
enabled (which is the default).
This has been reported to eclipse :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=384073 which closed it without
change in eclipse.
This also has a high number of votes on
http://stackoverflow.com/questions/6290470/eclipse-debugger-always-blocks-on-threadpoolexecutor-without-any-obvious-excepti
and is deemed as quite annoying.
The attached patch fixes tomcat by not letting the exception go out of
Thread.run() and thus trigger the debugger. Instead, a custom exception is
thrown to have the Thread go out of the ThreadPool and then caught and
swallowed before Thread.run() returns.
Patch is against tomcat 8 trunk and passes checkstyle and NIO2 tests.
--
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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
Sylvain Laurent <sl...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Sylvain Laurent <sl...@apache.org> ---
I merged to tomcat 7 : r1593392
The fix will be available in tomcat 7.0.54 and tomcat 8.0.6
--
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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
Trunk is CTR, so fire away. If you wrote the original code, I can't think of a
better person to refactor 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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
--- Comment #3 from Sylvain Laurent <sl...@apache.org> ---
(In reply to Christopher Schultz from comment #2)
> My question would be why there is an exception thrown here to handle this
> case at all. Instead, why not check to see if we should die cleanly, then
> emit the recycling message to the log and simply exit the run method?
>
> I don't understand why an exception is being used here at all.
Because actually in normal operation those threads never go out of
java.util.concurrent.ThreadPoolExecutor.runWorker(Worker) unless there are more
threads than the corePoolSize and the task queue is empty.
So, when I worked on the renewal of threads to avoid classloader leaks upon
undeployment, the only way I found was to throw an exception in our
implementation of ThreadPoolExecutor.afterExecute(Runnable, Throwable).
Is it OK for me to commit on tomcat 8 trunk?
--
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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
--- Comment #1 from Sylvain Laurent <sl...@apache.org> ---
Created attachment 31592
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31592&action=edit
proposed patch for tomcat 8
--
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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
--- Comment #5 from Sylvain Laurent <sl...@apache.org> ---
committed to tomcat 8 trunk : r1593132
what about tomcat 7 ? is it still CTR as stated in
https://wiki.apache.org/tomcat/TomcatVersions
--
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 56492] Avoid eclipse debugger pausing on uncaught exceptions
when tomcat renews its threads
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56492
--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
My question would be why there is an exception thrown here to handle this case
at all. Instead, why not check to see if we should die cleanly, then emit the
recycling message to the log and simply exit the run method?
I don't understand why an exception is being used here at all.
--
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