What happens to requests when tomcat stops

2019-06-15 12:01发布

What happens to http requests that are being processed when you stop or restart tomcat in the "normal" way? Will they be processed until the response is finished or are the http-threads interrupted? Is there a way to configure graceful stopping?

2条回答
爷的心禁止访问
2楼-- · 2019-06-15 12:19

Tomcat supports unloadDelay which waits till the configured time for unloading servlets.

This should configured in context.xml as follows:

<context unloadDelay="10000">

References:

查看更多
爷的心禁止访问
3楼-- · 2019-06-15 12:21

IT just kill the request and break the request-response link. And you get..

Unable to connect

  Browser can't establish a connection to the server at Host:port.

  The site could be temporarily unavailable or too busy. Try again in a few moments.
  If you are unable to load any pages, check your computer's network connection.
  If your computer or network is protected by a firewall or proxy, make sure that Browser is permitted to access the Web.

That can not be handled.

查看更多
登录 后发表回答