tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: All worker threads of my tomcat have been occupied!
Date Thu, 02 Jan 2014 17:47:32 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Benimaur,

On 1/2/14, 5:20 AM, Benimaur Gao wrote:
> I found my tomcat refusing to work this morning. I tried jstack to
> get some info, and then I found a lot of thread call stack like:
> 
> "http-8082-154" daemon prio=10 tid=0x00007f711c21f800 nid=0x5b0a
> waiting on
>> condition [0x00007f70dc887000] java.lang.Thread.State:
>> TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native
>> Method) at 
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:132)

Your
>> 
context (aka web application) is reloading. That's the only time
StandardContextValve calls Thread.sleep() -- and only in Tomcat 6.
Tomcat 7 and 8 don't do this.

The request coming from the remote client (indicated by the use of the
"http-xxxx-yyyy" thread name) is waiting on the webapp to complete its
reload. You'll see one of these threads in this state for each request
you got since the webapp started reloading.

> It seems all of the 200 JIoEndpoint$Worker threads had been
> occupied. and I guess that's why tomcat refuse to serve any
> incoming request.

Sounds about right.

> After I got a copy of the source of my tomcat. I found $ grep -B3
> -A8 context.getPaused\(\) 
> /home/benimaur/workspace/eclipse/tomcat/src/org/apache/catalina/core/StandardContextValve.java
>
> 
>> 126- 127-        // Wait if we are reloading 128-        boolean
>> reloaded = false; 129:        while (context.getPaused()) { 130-
>> reloaded = true; 131-            try { 132-
>> Thread.sleep(1000); 133-            } catch (InterruptedException
>> e) { 134-                ; 135-            } 136-        } 137-
>> 
> 
> It seems context had been set to reload state at some time, but I
> can't figure out under what  circumstance would put tomcat into
> such state. does any one here could give me more clue? thanks in
> advance.

Do you use the manager app? What are your <Engine> settings for things
like reloading, etc. from server.xml?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSxaYzAAoJEBzwKT+lPKRY7FAP/1UHDzaui8CrPV2E5JvCRDvF
QlMagAJmIN0+2Lm9LwTNG05ExmOTiH3AEf3hfiBC+YrzWc+jDYbCasDwjoCYMEuS
ZYgRIMO+nfzVyMhDEK8e9/AHfEg7YN/4R6EmWH4bv8MvMmnS9px1JzGI78BfggkT
v550utxeKGIS/C21YRwJWsqFg16TdfRWhBLe/TZYbdpoNzkHjTstTJ+18iAZZZpC
0rkqpT4QW/KL28CGFNdo4hmN459zFBoLte1p3ZfMXBmvg4WmOavaGBlyblNQWD8k
BMlaidAjRdkZXdI9zXGqz9NVGPP87+YAPPQxAXw2zcnqYyNTHhtA62mn3keq3gS7
cMuyrTXezFvdkOS+pQn3NtEQeI57S8GEO/WZnmNHpQYOQEyUVKPGBiyK3tYmcDVf
3bWIRykp7kP6HG2gxHaeIZWhwo6ub6UtFiSSW413NzX4x4k4EuP7bWO5rdMwgK2i
bIZTV8KLwkF7x8xsxDAIZdkhBgydQRzN1XtO+nB6mNql7v/hl5kf1ncHQK8ed2FW
jy2qzgqI43XF3gtnTrk6FLUeMYxDfaavTB/6Ge7d7AQHKClAy9Qc4WPdjANu6zkC
jJ/pu1BBD85Aa2pkswYwnCmnGUgtfjBLCmMeSrkhLSPqxvll/oQkoF0Qz4wGkOJL
2UARqAHN6uEn7c6XZ4Yb
=gfWU
-----END PGP SIGNATURE-----

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


Mime
View raw message