11

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:

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

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

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

AdrianES
  • 670
  • 3
  • 13
  • 29

4 Answers4

14

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

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.

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>

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

You can also set it with the asadmin tool like this:

asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.request-timeout-seconds=x
unwichtich
  • 13,712
  • 4
  • 53
  • 66
  • I set the Request Timeout to -1 (with no limit) in my glassfish and the problem disappeared. Thanks for the help. – AdrianES Mar 27 '14 at 11:10
5

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

GRIZZLY0023: Interrupting idle Thread:

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.

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

Tushar Patel
  • 365
  • 3
  • 16
  • We have the same issue with exact this version. But shouldn't the glassfish kill the connection. What else is the idea of this parameter and why doens't it kill the idling connection? – jan Sep 26 '14 at 15:36
  • 1
    We observed this happens only if the server is _not_ run in debug mode! That's why we saw this only in production, not in testing. – jan Oct 08 '14 at 13:15
  • I'll second what @jan said, so frustrating, only happens when *not* in debug mode. – Steve Kehlet May 20 '15 at 17:21
4

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.jar on Glassfish's classpath.

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

Tobb
  • 11,850
  • 6
  • 52
  • 77
  • I know this is old but where can I download this patch file. I'm currently running glassfish 3.1.2.2 and I'm hitting this exact bug. The link you mention is password protected. Thanks! – Gerb Jan 10 '19 at 23:33
  • Seems they have added password protection for parts of their site since I added the link. Found a guide on how to get access, not sure if it works though: https://www3.wipo.int/confluence/display/wipoimd/Accessing+restricted+pages You should consider upgrading glassfish though, 3.1.2.2 has known vulnerabilities – Tobb Jan 11 '19 at 08:10
1

You need to increase or disable the Request Timeout in the Glassfish Admin:

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

A value of -1 will disable it.

Tested in: GlassFish Server Open Source Edition 3.1.2.2