Re: Possible AbstractProtocol.waitingProcessors leak in Tomcat 9.0.75

2023-08-18 Thread Rubén Pérez
This is a response to an existing thread (about Memory leak in recent
versions of Tomcat):

https://www.mail-archive.com/users@tomcat.apache.org/msg141882.html

I haven't found a way to reply publicly as a continuation of that thread.
So here it goes what I am trying to say:

I started experiencing exactly the same issue when updating from Spring
6.0.7 to 6.0.9, therefore updating tomcat from 10.1.5 to 10.1.8. The Memory
leak is very clearly visible in my monitoring tools. A further heap dump
reveals like many times more entries in waitingProcessors map than real
active connections, and we end up with like 8 retained GB in memory full of
those entries.

I believe I have found a way to reproduce the issue locally. Open a
websocket session from a client in Chrome, go to dev-tools and switch the
tab to offline mode, wait > 50secs, go and switch it back to No Throttling.
Sometimes I get an error back to the client like:

a["ERROR\nmessage:AMQ229014\\c Did not receive data from /192.168.0.1\\c12720
within the 5ms connection TTL. The connection will now be
closed.\ncontent-length:0\n\n\u"]

And other times I get instead something like c[1002, ""] from Artemis
followed by an "Invalid frame header" error from Chrome (websockets view in
dev-tools).

Only when it is the latter case, looks to be leaking things in that map.
Maybe it is a casualty or not, but that is what I have observed at least 2
times.

After the error appeared, I waited long enough for FE to reconnect the
session, and then I just quitted Chrome.

Again, after forcefully downgrading Tomcat 10.1.8 to 10.1.5 while
preserving the same Spring version, the issue is gone (confirmed in
production), in fact I have never managed to get an "Invalid frame header"
in Chrome again with Tomcat 10.1.5 (in like 10 attempts). Before I got it
in 2 out of 4 attempts.

Is this something already tracked?

Best regards,
Ruben


tomcat timeouts on startup and on context deployment

2023-08-18 Thread Ivano Luberti
Hello eveybody, in one of my use case, when upgrading a web application 
it coult happen that on startup the application has to perform some 
database operation that could require some time, even some minutes.


This happens typically when deploying the application via tomcat manager 
but could possibly happen when starting tomcat if the war file has been 
replaced while tomcat was down.


Where can I configure these timeouts?

In eclipse I have found the timeout for the tomcat server but via the 
eclipse interface.


I have searched tomcat documentation but to no avail..

I'm using tomcat 8.5 and tomcat 9

TIA


--

Archimede Informatica tratta i dati personali in conformità a quanto
stabilito dal Regolamento UE n. 2016/679 (GDPR) e dal D. Lgs. 30 giugno 
2003 n. 196

per come modificato dal D.Lgs. 10 agosto 2018 n. 101.
Informativa completa 



dott. Ivano Mario Luberti

Archimede Informatica società cooperativa a r. l.
Via Gereschi 36, 56127 Pisa

tel.: +39 050/580959 | fax: +39 050/8932061

web: www.archicoop.it
linkedin: www.linkedin.com/in/ivanoluberti
facebook: www.facebook.com/archimedeinformaticapisa/


Re: tomcat timeouts on startup and on context deployment

2023-08-18 Thread Christopher Schultz

Ivano,

On 8/18/23 10:18, Ivano Luberti wrote:
Hello eveybody, in one of my use case, when upgrading a web application 
it coult happen that on startup the application has to perform some 
database operation that could require some time, even some minutes.


This happens typically when deploying the application via tomcat manager 
but could possibly happen when starting tomcat if the war file has been 
replaced while tomcat was down.


Where can I configure these timeouts?


What timeouts, specifically?

-chris

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



Re: tomcat timeouts on startup and on context deployment

2023-08-18 Thread Ivano Luberti

Hi Christopher.

It seems I had explained myself badly. I'll try again.

I need to know if there is and it is configurable a timeout on tomcat 
startup (in Eclipse you can configure it in the server configuration 
interface)


I need also to know if there is and it is configurable a timeout on 
application deployment when you use tomcat manager to deploy a war file 
or application start, fom tomcat manager interface as well


Il 18/08/2023 22:57, Christopher Schultz ha scritto:

Ivano,

On 8/18/23 10:18, Ivano Luberti wrote:
Hello eveybody, in one of my use case, when upgrading a web 
application it coult happen that on startup the application has to 
perform some database operation that could require some time, even 
some minutes.


This happens typically when deploying the application via tomcat 
manager but could possibly happen when starting tomcat if the war 
file has been replaced while tomcat was down.


Where can I configure these timeouts?


What timeouts, specifically?

-chris

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


--

Archimede Informatica tratta i dati personali in conformità a quanto
stabilito dal Regolamento UE n. 2016/679 (GDPR) e dal D. Lgs. 30 giugno 
2003 n. 196

per come modificato dal D.Lgs. 10 agosto 2018 n. 101.
Informativa completa 



dott. Ivano Mario Luberti

Archimede Informatica società cooperativa a r. l.
Via Gereschi 36, 56127 Pisa

tel.: +39 050/580959 | fax: +39 050/8932061

web: www.archicoop.it
linkedin: www.linkedin.com/in/ivanoluberti
facebook: www.facebook.com/archimedeinformaticapisa/


Re: tomcat timeouts on startup and on context deployment

2023-08-18 Thread Christopher Schultz

Ivano,

On 8/18/23 18:17, Ivano Luberti wrote:

It seems I had explained myself badly. I'll try again.

I need to know if there is and it is configurable a timeout on tomcat 
startup (in Eclipse you can configure it in the server configuration 
interface)


I need also to know if there is and it is configurable a timeout on 
application deployment when you use tomcat manager to deploy a war file 
or application start, fom tomcat manager interface as well


Tomcat doesn't wait for anything on startup except for the web 
applications to deploy. If your application takes long to start, Tomcat 
will take long to start. But Tomcat won't say "it's been 60 seconds, 
sorry, I'm killing the application" or anything like that.


If you use the Manager web application to deploy an application, it's 
possible that the tool you use for deployment (e.g. curl, or whatever 
makes the call to Tomcat's manager-deploy action) will have an HTTP 
timeout. Tomcat will complete the deployment work, but the 
deploying-client might not get a successful HTTP response within that 
time period.


But that's a timeout on the client end, not on Tomcat's end.

I'm just guessing at what timeout you are talking about, here. I may be 
totally off.


You said that Eclipse had a configurable timeout. What is that for / 
what is it called / what does it do?


-chris


Il 18/08/2023 22:57, Christopher Schultz ha scritto:

Ivano,

On 8/18/23 10:18, Ivano Luberti wrote:
Hello eveybody, in one of my use case, when upgrading a web 
application it coult happen that on startup the application has to 
perform some database operation that could require some time, even 
some minutes.


This happens typically when deploying the application via tomcat 
manager but could possibly happen when starting tomcat if the war 
file has been replaced while tomcat was down.


Where can I configure these timeouts?


What timeouts, specifically?

-chris

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



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



Re: tomcat timeouts on startup and on context deployment

2023-08-18 Thread Maxim Solodovnik
from mobile (sorry for typos ;)


On Sat, Aug 19, 2023, 10:49 Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Ivano,
>
> On 8/18/23 18:17, Ivano Luberti wrote:
> > It seems I had explained myself badly. I'll try again.
> >
> > I need to know if there is and it is configurable a timeout on tomcat
> > startup (in Eclipse you can configure it in the server configuration
> > interface)
> >
> > I need also to know if there is and it is configurable a timeout on
> > application deployment when you use tomcat manager to deploy a war file
> > or application start, fom tomcat manager interface as well
>
> Tomcat doesn't wait for anything on startup except for the web
> applications to deploy. If your application takes long to start, Tomcat
> will take long to start. But Tomcat won't say "it's been 60 seconds,
> sorry, I'm killing the application" or anything like that.
>
> If you use the Manager web application to deploy an application, it's
> possible that the tool you use for deployment (e.g. curl, or whatever
> makes the call to Tomcat's manager-deploy action) will have an HTTP
> timeout. Tomcat will complete the deployment work, but the
> deploying-client might not get a successful HTTP response within that
> time period.
>
> But that's a timeout on the client end, not on Tomcat's end.
>
> I'm just guessing at what timeout you are talking about, here. I may be
> totally off.
>
> You said that Eclipse had a configurable timeout. What is that for /
> what is it called / what does it do?
>

Initializing of SecureRandom might cause long tomcat start
You can switch to /dev/urandom (less secure)



> -chris
>
> > Il 18/08/2023 22:57, Christopher Schultz ha scritto:
> >> Ivano,
> >>
> >> On 8/18/23 10:18, Ivano Luberti wrote:
> >>> Hello eveybody, in one of my use case, when upgrading a web
> >>> application it coult happen that on startup the application has to
> >>> perform some database operation that could require some time, even
> >>> some minutes.
> >>>
> >>> This happens typically when deploying the application via tomcat
> >>> manager but could possibly happen when starting tomcat if the war
> >>> file has been replaced while tomcat was down.
> >>>
> >>> Where can I configure these timeouts?
> >>
> >> What timeouts, specifically?
> >>
> >> -chris
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>