当tomcat停止时,请求会发生什么 [英] What happens to requests when tomcat stops

查看:310
本文介绍了当tomcat停止时,请求会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以正常方式停止或重新启动tomcat时正在处理的http请求会发生什么?
它们会被处理,直到响应完成或者http线程被中断了吗?
有没有办法配置正常停止?

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?

推荐答案

Tomcat支持 unloadDelay 等待卸载servlet的配置时间。

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

这应该在 context.xml 中配置为如下:

This should configured in context.xml as follows:

<context unloadDelay="10000">

参考文献:


  • 上下文配置指南

  • < a href =http://autodidatastech.blogspot.in/2011/04/tomcat-unloaddelay-attribute.html> Tomcat unloadDelay属性

  • Context Config guide
  • Tomcat unloadDelay attribute

这篇关于当tomcat停止时,请求会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆