tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Bauer <peter.ba...@apus.co.at>
Subject Re: All threads are currently busy
Date Thu, 18 Oct 2007 07:34:01 GMT
Am Mittwoch 17 Oktober 2007 schrieb Johnny Kewl:
> ---------------------------------------------------------------------------
> HARBOR: http://coolharbor.100free.com/index.htm
> Now Tomcat is also a cool application server
> ---------------------------------------------------------------------------
> ----- Original Message -----
> From: "Peter Bauer" <peter.bauer@apus.co.at>
> To: <users@tomcat.apache.org>
> Sent: Wednesday, October 17, 2007 5:24 PM
> Subject: Re: All threads are currently busy
>
> > Good afternoon Martin :-)
> >
> > On Wednesday 18 October 2000 16:08:34 you wrote:
> >> Good Morning Peter
> >>
> >> I assume you have built glibc for debian following the specific build
> >> instructions for debian..following this example
> >> http://www.linux-m32r.org/eng/download.html#debpackage
> >
> > I did not build the libc packages myself, currently
> > libc6 2.3.2.ds1-22
> > libc6-dev 2.3.2.ds1-22
> > are installed.
> >
> >> This version of TC is quite old ..not sure if its supported anymore
> >
> > Yes, i know about that. If there is a major bug in this version, i could
> > argue to upgrade
> > (at least to the last 4.1.x version) but i would need some facts to be
> > able to do so.
> >
> >> Can we see the source for the removeActiveRole
>
> I was hoping to see a thread WAIT or something like that... no such luck ;)
> I'm wondering if DatabaseAccess is shared and another thread (in another
> servlet) wrecks the connection as this uses it.... maybe...
> Maybe there is a subtle loop.... through the POST, its waiting for reply,
> which is in another thread, which is waiting for this thread...
>
> OK... I'm finished guessing ;)

Thank you, i think i finally got it because you made me think about the method 
again:

> >    public static synchronized void removeActiveRoles(final DatabaseAccess
> > dba, final String terminalid, final String sessionid, boolean isNam) {

This next method call is the problem. I am sending a POST request from one 
servlet instance to another one. But in situations with high load, all 20 
instances are busy, so the ActiveRoleRemoval.sendLogoutMessages method which 
sends the POST request blocks because there is no other instance/thread to 
process the request.
Is this quite possible or nonsense?

> >        //send faked logout message via HTTP POST to commDicora servlet
> > for failed roles
> >        if(!ActiveRoleRemoval.sendLogoutMessages(failedRoles, sessionid))
> > { LOG.error("Sending logout messages for failed roles failed,
> > continuing");
> >        }

To solve this problem, i have to avoid using other servlet instances for 
completing the doPost method since it is always possible that no other 
instance is available and waiting for a request.

thx,
Peter

> >
> >> specifically are there higher priority threads currently executing so
> >> perhaps yield to those threads may apply?
> >> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html
> >
> > There are no threads i am creating which have a non-default priority.
> >
> > thanks,
> > Peter
> >
> >> HTH/
> >> Martin--
> >>
> >> ----- Original Message -----
> >> From: "Peter Bauer" <peter.bauer@apus.co.at>
> >> To: <users@tomcat.apache.org>
> >> Sent: Wednesday, October 17, 2007 4:52 AM
> >> Subject: All threads are currently busy
> >>
> >> > Hi all,
> >> >
> >> > System:
> >> > Tomcat 4.1.30 on Debian sarge
> >> > java version "1.5.0_11"
> >> > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> >> > Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
> >> >
> >> > in situations with high load, tomcat sometimes stops responding and is
> >> > not
> >>
> >> able to recover from that status. In the catalina.out file, i get the
> >>
> >> following line:
> >> > SEVERE: All threads (75) are currently busy, waiting. Increase
> >> > maxThreads
> >>
> >> (75) or check the servlet status
> >>
> >> > i searched some time in various forums and mailing list archives and
> >> > found
> >>
> >> the following links:
> >>
> >> http://mail-archives.apache.org/mod_mbox/tomcat-users/200408.mbox/%3c200
> >>4Au g 01.0922.scs.0012@eskimo.com%3e
> >>
> >> > http://marc.info/?l=tomcat-user&m=113297294417902&w=2
> >> > http://www.tek-tips.com/viewthread.cfm?qid=862552&page=3
> >> > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg127833.h
> >> >tml
> >> >
> >> > Basically there seem to be 2 possible reasons for this behaviour
> >> > 1. A bug (?) in Tomcat or the combination of JDK, glibc, whatever,
> >> > which
> >>
> >> causes that tomcat does not
> >>
> >> > recover from situations with too much requests. I could not find any
> >>
> >> information in the release notes
> >>
> >> > of the Tomcat 4.1.x versions.
> >> > 2. Some kind of deadlock or resource (database connections)
> >> > availability
> >>
> >> problem which
> >>
> >> >    keeps the request handling threads from returning from the
> >> > doPost/Get
> >>
> >> method.
> >>
> >> > So i made a Threaddump using jstack (attached file). Most of the
> >> > threads
> >>
> >> are in
> >>
> >> >  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
> >> >  - java.lang.Object.wait() @bci=2, line=474 (Interpreted frame)
> >> >  - org.apache.catalina.core.StandardWrapper.allocate() @bci=223,
> >> > line=704
> >>
> >> (Interpreted frame)
> >>
> >> > but 19 threads are blocked in the bci 0 of the same static
> >> > synchronized
> >>
> >> method called removeActiveRoles
> >>
> >> > which is called from the doPost() method.
> >> >
> >> >  -
> >>
> >> at.sonorys.dmc.utilities.ActiveRoleRemoval.removeActiveRoles(at.sonorys.
> >>dmc . utilities.DatabaseAccess, java.lang.String, java.lang.String,
> >> boolean) @bci=0 (Interpreted frame)
> >>
> >> >  - at.sonorys.dmc.CommDicora.CommHandleMessageSession.quitSession()
> >>
> >> @bci=23 (Interpreted frame)
> >>
> >> >  -
> >> > at.sonorys.dmc.CommDicora.CommHandleMessageSession.doHandleSessionMsg(
> >> >)
> >>
> >> @bci=131 (Interpreted frame)
> >>
> >> >  - at.sonorys.dmc.CommDicora.CommHandleMessageSession.evalMessage()
> >> > @bci=1
> >>
> >> (Interpreted frame)
> >>
> >> >  -
> >>
> >> at.sonorys.dmc.CommDicora.CommDicoraServlet.doHandleMsg(javax.servlet.ht
> >>tp. H ttpServletResponse, javax.servlet.http.HttpServletRequest) @bci=103
> >> (Interpreted frame)
> >>
> >> >  -
> >>
> >> at.sonorys.dmc.CommDicora.CommDicoraServlet.doPost(javax.servlet.http.Ht
> >>tpS e rvletRequest, javax.servlet.http.HttpServletResponse) @bci=142
> >> (Interpreted frame)
> >>
> >> > The servlet implements the SingleThreadModel (not my decision). As you
> >> > can
> >>
> >> see from the threaddump, all 19 threads are waiting to
> >>
> >> > get into the same static synchronized method. I dont understand this
> >>
> >> because there must be one thread IN the method
> >>
> >> > which holds the lock of the method? Is it possible for a thread to
> >> > leave
> >> > a
> >>
> >> synchronized method without returning the
> >>
> >> > lock?
> >> >
> >> > br,
> >> > Peter
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org



-- 
Peter Bauer
APUS Software G.m.b.H.
A-8074 Raaba, Bahnhofstrasse 1/1
Email: peter.bauer@apus.co.at
Tel: +43 316 401629 24
Fax: +43 316 401629 9

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


Mime
View raw message