You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sascha Troll <sa...@geberit.com> on 2013/05/17 11:13:54 UTC
Tomcat hangs every day
Hi !
I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
and 7.0.37 and still the same issue).
Its still running, but not longer accepting any connection on port 8080.
Attached are the thread dumps which were created this morning when the
server was not longer available.
I cannot find any deadlocks and need some help to find the cause.
Thanks
Sascha
--------------------------------------------------------------------------------------------------
Disclaimer:
The content of this e-mail (including attachments) is confidential and intended for the use of the addressee only. If you are not the intended recipient please delete the e-mail; dissemination or disclosure of its content to anyone is strictly prohibited!
Before opening an attachment please check it for viruses. We accept no liability for any damage caused by viruses.
Re: Tomcat hangs every day
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Sascha,
On 5/17/13 7:22 AM, Sascha Troll wrote:
> Can you give me a hint. I am just the server guy, so I can tell the
> developer.
Tell the developers to set connection- and read-timeouts when using
HttpClient (or whatever uses HttpClient). They should know what you
are talking about. If they don't know what you are talking about, you
need some new developers.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJRmmtgAAoJEBzwKT+lPKRYJ4AP/1/kqMQcaZdUwPKtHV0j7MFN
GqoF89slZTPDnfaBm1jxVH24GfMALGicZB4Zc/SwAlC/LeWO4Y4Ct8CNFEreZ8XA
fBL5niR2PuTGBYtPGY8+kRYuQTeglxlIvNWOMcm3/9sPf1EFH81vV1etAxuaswqb
OKfqnlP2ekzNPKD8GOylnG8mcXt4jLlFHVhRx03rHW1rlvNRifKPpDbCyZNWN1h7
ABneJ/RhylDuPDcDbIQIwSaKXRRMDXAq05Yjf9o+lz879JOi+eAxib9L5pmMO7RS
AB/rU7d2dfRYyfC3aLfYtC1eOXgORS2El6JYqekhZX7L6KSglWdHC28W8D0TQmgK
OWilDMrox0pTvQQkzIEepM+RbUzm6XgzEA6CUOz+NBUGHEv7s1RPXr4Br+K2Za8d
1FPj//5PmdhZ3NqE+HJ18O0hK/2Si+eQ2SDnWNiSY9UFw7/wsArWWWuFurb5TQet
d5fcnv4jw4WwmoQ3UH4iUGtV/k/HrSnkLHFLrORgVnn8l9GJS2kBo5Tq1Ffl6FRK
bggqEHmEb4O+JrOtcqJKjU7O00uqV5rXP1hdhw4r3ytQ+qHtWrTCUiVEgN/qxAmz
r+6/KTvWomIsqkdwmzhTWXtuHay4PmwP2Yl4nM6aIGfREKo0TwacR93+9FSvPYQc
+j3tTY6t5n0BKzTWK1Vs
=8v5P
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat hangs every day
Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
I don't use HttpClient, directly, but if I'm not mistaking, javax.mail.jar
(JavaMail) and Google Calendar API uses HttpClient, and I use JavaMail and
Google Calendar API, directly, in my app.
Google Calendar API seemed to always close their connections and I have
even experienced downtime (host unknown and/or server error responses from
Google Calendar API service), and I have experienced downtime (unknown host
exceptions) when using JavaMail to connect to GMAIL (via IMAP connection)
to check-for-and-download emails.
Some months ago, I recognized that I had many unclosed connections on my
Windows Server 2008 production server, where Tomcat was running my app.
Instead of blame Tomcat, I listened in on Tomcat user list and I searched
the internet, and learned that the unclosed connections were due to my
inexperience (using JavaMail), so I refactored my code and closed my
JavaMail IMAP connection when checking-and-downloading emails from GMAIL
(google) servers.
I just searched google,
stackoverflow tomcat httpclient timeout[1]
and found the following:
Best Practice to Use HttpClient in Multithreaded Environment[2]
Using Apache HttpClient how to set the TIMEOUT on a request and response[3]
and many more search results (and related links) that you can read.
[1] http://lmgtfy.com/?q=stackoverflow+tomcat+httpclient+timeout
[2]
http://stackoverflow.com/questions/1281219/best-practice-to-use-httpclient-in-multithreaded-environment
[3]
http://stackoverflow.com/questions/9873810/using-apache-httpclient-how-to-set-the-timeout-on-a-request-and-response
On Fri, May 17, 2013 at 8:02 AM, Paolo Botta <pa...@cabril.it> wrote:
> Sorry for the question, but if I set the timeout on the HttpClient I force
> the client to close the connection after the timeout, but have I informed
> the server that there is a timeout, so the server close the connection
> after
> the timeout? I mean HttpClient tells to the server about the timeout?
>
> Thx
> Paolo
>
> -----Messaggio originale-----
> Da: chkalt@gmail.com [mailto:chkalt@gmail.com] Per conto di Christian
> Kaltepoth
> Inviato: venerdì 17 maggio 2013 13:30
> A: Tomcat Users List
> Oggetto: Re: Tomcat hangs every day
>
> Hey,
>
> I'm also not an expert for HttpClient, but when creating connections to
> remote services it is usually a good idea to set connection timeouts and
> socket timeouts so that the client doesn't block forever if there are
> problems with the connection. Exactly this seems to be the problem in your
> case.
>
> Best regards
>
> Christian Kaltepoth
>
>
>
>
> 2013/5/17 Sascha Troll <sa...@geberit.com>
>
> > Christian,
> >
> > thanks for this.
> >
> > Can you give me a hint. I am just the server guy, so I can tell the
> > developer.
> >
> > Thanks a lot !
> >
> > Sascha
> >
> >
> >
> > From: Christian Kaltepoth <ch...@kaltepoth.de>
> > To: Tomcat Users List <us...@tomcat.apache.org>
> > Date: 17.05.2013 11:24
> > Subject: Re: Tomcat hangs every day
> > Sent by: chkalt@gmail.com
> >
> >
> >
> > Seems like you have a class called SearchClientRemoteClient which uses
> > HTTPClient. Many threads seems to wait for remote responses. I guess
> > you don't set any timeouts for the HTTPClient and therefore many
> > threads hang in HttpClient.executeMethod() forever. You should ALWAYS
> > set timeouts when using HTTPClient. :)
> >
> > I hope this helps :)
> >
> > Christian
> >
> >
> > 2013/5/17 Sascha Troll <sa...@geberit.com>
> >
> > > Hi !
> > >
> > > I have problem with our Tomcat 7.0.40 (upgrade already done from
> > > 7.0.39 and 7.0.37 and still the same issue).
> > >
> > > Its still running, but not longer accepting any connection on port
> 8080.
> > >
> > > Attached are the thread dumps which were created this morning when
> > > the server was not longer available.
> > > I cannot find any deadlocks and need some help to find the cause.
> > >
> > >
> > >
> > > Thanks
> > > Sascha
> > >
> > >
> > >
> > >
> >
> > ----------------------------------------------------------------------
> > ----------------------------
> > > Disclaimer:
> > > The content of this e-mail (including attachments) is confidential
> > > and intended for the use of the addressee only. If you are not the
> > > intended recipient please delete the e-mail; dissemination or
> > > disclosure of its content to anyone is strictly prohibited!
> > > Before opening an attachment please check it for viruses. We accept
> > > no liability for any damage caused by viruses.
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> >
> >
> >
> > --
> > Christian Kaltepoth
> > Blog: http://blog.kaltepoth.de/
> > Twitter: http://twitter.com/chkal
> > GitHub: https://github.com/chkal
> >
> >
> >
> >
> >
> >
> > ----------------------------------------------------------------------
> > ----------------------------
> > Disclaimer:
> > The content of this e-mail (including attachments) is confidential and
> > intended for the use of the addressee only. If you are not the
> > intended recipient please delete the e-mail; dissemination or
> > disclosure of its content to anyone is strictly prohibited!
> > Before opening an attachment please check it for viruses. We accept no
> > liability for any damage caused by viruses.
> >
>
>
>
> --
> Christian Kaltepoth
> Blog: http://blog.kaltepoth.de/
> Twitter: http://twitter.com/chkal
> GitHub: https://github.com/chkal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
R: Tomcat hangs every day
Posted by Paolo Botta <pa...@cabril.it>.
Sorry for the question, but if I set the timeout on the HttpClient I force
the client to close the connection after the timeout, but have I informed
the server that there is a timeout, so the server close the connection after
the timeout? I mean HttpClient tells to the server about the timeout?
Thx
Paolo
-----Messaggio originale-----
Da: chkalt@gmail.com [mailto:chkalt@gmail.com] Per conto di Christian
Kaltepoth
Inviato: venerdì 17 maggio 2013 13:30
A: Tomcat Users List
Oggetto: Re: Tomcat hangs every day
Hey,
I'm also not an expert for HttpClient, but when creating connections to
remote services it is usually a good idea to set connection timeouts and
socket timeouts so that the client doesn't block forever if there are
problems with the connection. Exactly this seems to be the problem in your
case.
Best regards
Christian Kaltepoth
2013/5/17 Sascha Troll <sa...@geberit.com>
> Christian,
>
> thanks for this.
>
> Can you give me a hint. I am just the server guy, so I can tell the
> developer.
>
> Thanks a lot !
>
> Sascha
>
>
>
> From: Christian Kaltepoth <ch...@kaltepoth.de>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Date: 17.05.2013 11:24
> Subject: Re: Tomcat hangs every day
> Sent by: chkalt@gmail.com
>
>
>
> Seems like you have a class called SearchClientRemoteClient which uses
> HTTPClient. Many threads seems to wait for remote responses. I guess
> you don't set any timeouts for the HTTPClient and therefore many
> threads hang in HttpClient.executeMethod() forever. You should ALWAYS
> set timeouts when using HTTPClient. :)
>
> I hope this helps :)
>
> Christian
>
>
> 2013/5/17 Sascha Troll <sa...@geberit.com>
>
> > Hi !
> >
> > I have problem with our Tomcat 7.0.40 (upgrade already done from
> > 7.0.39 and 7.0.37 and still the same issue).
> >
> > Its still running, but not longer accepting any connection on port 8080.
> >
> > Attached are the thread dumps which were created this morning when
> > the server was not longer available.
> > I cannot find any deadlocks and need some help to find the cause.
> >
> >
> >
> > Thanks
> > Sascha
> >
> >
> >
> >
>
> ----------------------------------------------------------------------
> ----------------------------
> > Disclaimer:
> > The content of this e-mail (including attachments) is confidential
> > and intended for the use of the addressee only. If you are not the
> > intended recipient please delete the e-mail; dissemination or
> > disclosure of its content to anyone is strictly prohibited!
> > Before opening an attachment please check it for viruses. We accept
> > no liability for any damage caused by viruses.
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
>
> --
> Christian Kaltepoth
> Blog: http://blog.kaltepoth.de/
> Twitter: http://twitter.com/chkal
> GitHub: https://github.com/chkal
>
>
>
>
>
>
> ----------------------------------------------------------------------
> ----------------------------
> Disclaimer:
> The content of this e-mail (including attachments) is confidential and
> intended for the use of the addressee only. If you are not the
> intended recipient please delete the e-mail; dissemination or
> disclosure of its content to anyone is strictly prohibited!
> Before opening an attachment please check it for viruses. We accept no
> liability for any damage caused by viruses.
>
--
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat hangs every day
Posted by Christian Kaltepoth <ch...@kaltepoth.de>.
Hey,
I'm also not an expert for HttpClient, but when creating connections to
remote services it is usually a good idea to set connection timeouts and
socket timeouts so that the client doesn't block forever if there are
problems with the connection. Exactly this seems to be the problem in your
case.
Best regards
Christian Kaltepoth
2013/5/17 Sascha Troll <sa...@geberit.com>
> Christian,
>
> thanks for this.
>
> Can you give me a hint. I am just the server guy, so I can tell the
> developer.
>
> Thanks a lot !
>
> Sascha
>
>
>
> From: Christian Kaltepoth <ch...@kaltepoth.de>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Date: 17.05.2013 11:24
> Subject: Re: Tomcat hangs every day
> Sent by: chkalt@gmail.com
>
>
>
> Seems like you have a class called SearchClientRemoteClient which uses
> HTTPClient. Many threads seems to wait for remote responses. I guess you
> don't set any timeouts for the HTTPClient and therefore many threads hang
> in HttpClient.executeMethod() forever. You should ALWAYS set timeouts when
> using HTTPClient. :)
>
> I hope this helps :)
>
> Christian
>
>
> 2013/5/17 Sascha Troll <sa...@geberit.com>
>
> > Hi !
> >
> > I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
> > and 7.0.37 and still the same issue).
> >
> > Its still running, but not longer accepting any connection on port 8080.
> >
> > Attached are the thread dumps which were created this morning when the
> > server was not longer available.
> > I cannot find any deadlocks and need some help to find the cause.
> >
> >
> >
> > Thanks
> > Sascha
> >
> >
> >
> >
>
> --------------------------------------------------------------------------------------------------
> > Disclaimer:
> > The content of this e-mail (including attachments) is confidential and
> > intended for the use of the addressee only. If you are not the intended
> > recipient please delete the e-mail; dissemination or disclosure of its
> > content to anyone is strictly prohibited!
> > Before opening an attachment please check it for viruses. We accept no
> > liability for any damage caused by viruses.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
>
> --
> Christian Kaltepoth
> Blog: http://blog.kaltepoth.de/
> Twitter: http://twitter.com/chkal
> GitHub: https://github.com/chkal
>
>
>
>
>
>
> --------------------------------------------------------------------------------------------------
> Disclaimer:
> The content of this e-mail (including attachments) is confidential and
> intended for the use of the addressee only. If you are not the intended
> recipient please delete the e-mail; dissemination or disclosure of its
> content to anyone is strictly prohibited!
> Before opening an attachment please check it for viruses. We accept no
> liability for any damage caused by viruses.
>
--
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
Re: Tomcat hangs every day
Posted by Sascha Troll <sa...@geberit.com>.
Christian,
thanks for this.
Can you give me a hint. I am just the server guy, so I can tell the
developer.
Thanks a lot !
Sascha
From: Christian Kaltepoth <ch...@kaltepoth.de>
To: Tomcat Users List <us...@tomcat.apache.org>
Date: 17.05.2013 11:24
Subject: Re: Tomcat hangs every day
Sent by: chkalt@gmail.com
Seems like you have a class called SearchClientRemoteClient which uses
HTTPClient. Many threads seems to wait for remote responses. I guess you
don't set any timeouts for the HTTPClient and therefore many threads hang
in HttpClient.executeMethod() forever. You should ALWAYS set timeouts when
using HTTPClient. :)
I hope this helps :)
Christian
2013/5/17 Sascha Troll <sa...@geberit.com>
> Hi !
>
> I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
> and 7.0.37 and still the same issue).
>
> Its still running, but not longer accepting any connection on port 8080.
>
> Attached are the thread dumps which were created this morning when the
> server was not longer available.
> I cannot find any deadlocks and need some help to find the cause.
>
>
>
> Thanks
> Sascha
>
>
>
>
--------------------------------------------------------------------------------------------------
> Disclaimer:
> The content of this e-mail (including attachments) is confidential and
> intended for the use of the addressee only. If you are not the intended
> recipient please delete the e-mail; dissemination or disclosure of its
> content to anyone is strictly prohibited!
> Before opening an attachment please check it for viruses. We accept no
> liability for any damage caused by viruses.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
--
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
--------------------------------------------------------------------------------------------------
Disclaimer:
The content of this e-mail (including attachments) is confidential and intended for the use of the addressee only. If you are not the intended recipient please delete the e-mail; dissemination or disclosure of its content to anyone is strictly prohibited!
Before opening an attachment please check it for viruses. We accept no liability for any damage caused by viruses.
Re: Tomcat hangs every day
Posted by Christian Kaltepoth <ch...@kaltepoth.de>.
Seems like you have a class called SearchClientRemoteClient which uses
HTTPClient. Many threads seems to wait for remote responses. I guess you
don't set any timeouts for the HTTPClient and therefore many threads hang
in HttpClient.executeMethod() forever. You should ALWAYS set timeouts when
using HTTPClient. :)
I hope this helps :)
Christian
2013/5/17 Sascha Troll <sa...@geberit.com>
> Hi !
>
> I have problem with our Tomcat 7.0.40 (upgrade already done from 7.0.39
> and 7.0.37 and still the same issue).
>
> Its still running, but not longer accepting any connection on port 8080.
>
> Attached are the thread dumps which were created this morning when the
> server was not longer available.
> I cannot find any deadlocks and need some help to find the cause.
>
>
>
> Thanks
> Sascha
>
>
>
> --------------------------------------------------------------------------------------------------
> Disclaimer:
> The content of this e-mail (including attachments) is confidential and
> intended for the use of the addressee only. If you are not the intended
> recipient please delete the e-mail; dissemination or disclosure of its
> content to anyone is strictly prohibited!
> Before opening an attachment please check it for viruses. We accept no
> liability for any damage caused by viruses.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
--
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal