tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Strange tomcat error and running out of file handles
Date Mon, 24 Jun 2013 21:19:19 GMT
> From: Daniel Mikusa [mailto:dmikusa@gopivotal.com] 
> Subject: Re: Strange tomcat error and running out of file handles

> > SEVERE: Unable to process request in NioReceiver
> > java.lang.ThreadDeath
> >        at java.lang.Thread.stop(Thread.java:758)
> >        at net.bull.javamelody.Action.stopThread(Action.java:388)

> Looks like your application is calling Thread.stop().

In case the OP is unaware, _any_ use of Thread.stop() is a serious mistake. The Javadoc description
warns against its usage, but the warning is nowhere near strong enough:

	stop()
Deprecated. 
This method is inherently unsafe. Stopping a thread with Thread.stop causes it to unlock all
of the monitors that it has locked (as a natural consequence of the unchecked ThreadDeath
exception propagating up the stack). If any of the objects previously protected by these monitors
were in an inconsistent state, the damaged objects become visible to other threads, potentially
resulting in arbitrary behavior. Many uses of stop should be replaced by code that simply
modifies some variable to indicate that the target thread should stop running. The target
thread should check this variable regularly, and return from its run method in an orderly
fashion if the variable indicates that it is to stop running. If the target thread waits for
long periods (on a condition variable, for example), the interrupt method should be used to
interrupt the wait. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume
Deprecated?.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


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


Mime
View raw message