Java GRIZZLY0023 玻璃鱼警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22666847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 17:11:25  来源:igfitidea点击:

GRIZZLY0023 Glassfish warning

javahttpglassfishwarningsgrizzly

提问by AdrianES

I have deployed 2 web application in java on GlassFish server. I am using Glassfish Server 3.1.2.2. They both have java servlet pages from where they receive http requests, also the code is identical, only different parameters (for different clients). The first works well and the other process the http request very long. After that i noticed the next thing:

我已经在 GlassFish 服务器上用 Java 部署了 2 个 Web 应用程序。我正在使用 Glassfish Server 3.1.2.2。它们都有 java servlet 页面,它们从中接收 http 请求,代码也是相同的,只有不同的参数(针对不同的客户端)。第一个运行良好,另一个处理 http 请求的时间很长。在那之后,我注意到了下一件事:

I am constantly getting this warning in the Glassfish output in Netbeans.

我在 Netbeans 的 Glassfish 输出中不断收到此警告。

WARNING: GRIZZLY0023: Interrupting idle Thread: http-thread-pool-9990

Can anyone explain me why i get this warning, and how to solve it.

谁能解释我为什么收到这个警告,以及如何解决它。

采纳答案by unwichtich

This warning occurs if a HTTP request times out. The Glassfish default timeout is 15 minutes.

如果 HTTP 请求超时,则会出现此警告。Glassfish 默认超时为15 分钟

This can happen in different situations, e.g. when a request invokes a long-running action which doesn't return any response in the timeout period, if a request to your server was made via HTTPS and it only supports HTTP (or vice versa), or if there are no more connections available in the HTTP connection pool.

这可能发生在不同的情况下,例如,当请求调用长时间运行的操作时,该操作在超时时间内不返回任何响应,如果对您的服务器的请求是通过 HTTPS 发出的,并且它仅支持 HTTP(反之亦然),或者 HTTP 连接池中没有更多可用连接。

The specific cause in your case can only be guessed, but in general one solution for this problem is to increase the default HTTP request timeout. You can set this value in the Glassfish Admin GUI (http://localhost:4848) under:

server-config-> Network Config-> Network Listeners-> <your listener>

您的情况的具体原因只能猜测,但通常此问题的一种解决方案是增加默认的 HTTP 请求超时。您可以在 Glassfish 管理 GUI ( http://localhost:4848) 下设置此值:

server-config-> Network Config-> Network Listeners-><your listener>

the field Request Timeoutis set to 900(15 minutes) by default, just increase this value. Unfortunately you can't set it to -1to have no limit since Glassfish 3.1.2.

该字段默认Request Timeout设置为900(15 分钟),只需增加此值即可。不幸的是,-1自 Glassfish 3.1.2 以来,您无法将其设置为没有限制。

You can also set it with the asadmintool like this:

您也可以使用这样的asadmin工具设置它:

asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.request-timeout-seconds=x

回答by Tushar Patel

This occurred when the server is idle. When the server is idle for some time then it start generating

这发生在服务器空闲时。当服务器空闲一段时间后,它开始生成

GRIZZLY0023: Interrupting idle Thread:

GRIZZLY0023:中断空闲线程:

warning in the log file and we have to restart the server. We observed this in Glassfish 3.1.2.2 build 5. We never observed this in older Glassfish.

日志文件中出现警告,我们必须重新启动服务器。我们在 Glassfish 3.1.2.2 build 5 中观察到了这一点。我们从未在旧版 Glassfish 中观察到这一点。

This indicates that there is some bug in GF 3.1.2.2 version.

这说明GF 3.1.2.2 版本存在一些bug。

回答by Armando Carrasco

You need to increase or disable the Request Timeoutin the Glassfish Admin:

您需要在 Glassfish Admin 中增加或禁用请求超时

server-config -> Network Config -> Network Listeners -> <LISTENER> -> HTTP

A value of -1 will disable it.

值为 -1 将禁用它。

Tested in: GlassFish Server Open Source Edition 3.1.2.2

测试:GlassFish Server Open Source Edition 3.1.2.2

回答by Tobb

I don't think I would recommend just disabling the interuption of threads altogether. Actually, this error is probably due to a bug in Glassfish 3.1.2.2, which results in threads not being properly interupted. This can be seen through multiple interupt-logs for the same thread-id. The bug is fixed by placing a patched version of grizzly-http.jaron Glassfish's classpath.

我不认为我会建议完全禁用线程的中断。实际上,这个错误可能是由于 Glassfish 3.1.2.2 中的一个错误导致线程没有正确中断。这可以通过同一线程 ID 的多个中断日志看到。通过grizzly-http.jar在 Glassfish 的类路径上放置一个补丁版本来修复该错误。

For more information, see https://www3.wipo.int/confluence/display/wipoimd/3.3.2.1.-+GlassFish+3.1.2.2+%28build+5%29+patches

有关更多信息,请参阅https://www3.wipo.int/confluence/display/wipoimd/3.3.2.1.-+GlassFish+3.1.2.2+%28build+5%29+patches