如何防止tomcat内存不足时ant任务挂起?
我们使用 tomcat ant 任务将应用程序部署到 tomcat6 和 tomcat7。不过,对于这两种情况,我们都看到一个问题,即当 tomcat 内存不足时(我知道是由于设置不当),页面请求会挂在那里并且不会失败。
但问题是这也会挂起我们的 ant 任务,我相信它只是像浏览器一样使用 http 。
所以我很好奇如何首先检查 ant 是否服务器正在运行,或者如何在部署任务上设置超时?
谢谢
We are using the tomcat ant tasks to deploy our applications to both tomcat6 and tomcat7. For both though, we see a problem that when tomcat is out of memory (due to bad setup, I know), page request hang in there and don't fail.
Problem though is that this also hangs our ant tasks, which I believe just use http like the browser does.
So I'm curious how I could first check in ant if the server is running, or perhaps set a timeout on the deploy tasks?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定如何检查服务器是否正在运行并避免连接挂起,但您可以运行超时的 Ant 任务。您可以通过 并行 任务来完成此操作 - 您通常会使用该任务同时执行构建步骤。该任务有超时(毫秒)设置。例如:
I'm not sure how you can check the server is running and avoid the connection hanging, but you can run an Ant task that times out. You can do this by means of the parallel task - which you would normally use to execute build steps simultaneously. The task has a timeout (milliseconds) setting. For example: