Oracle GlassFish Server Closes Connections In Keepalive While There Are More Data To Be Processed (Doc ID 1408034.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 2.1 to 2.1.1 [Release 2.1]
Information in this document applies to any platform.

Symptoms

On rare occasions, Oracle GlassFish server may close a connection that is in keepalive when there are still some more payload to be processed.

When this happens, the client will get HTTP 500 error, TCP/IP packet trace will show [RST] sent from GlassFish server.

With the following JVM switches turned on at the GlassFish server:

-Dcom.sun.enterprise.web.connector.grizzly.displayConfiguration=true
-Dcom.sun.enterprise.web.connector.grizzly.enableSnoop=true


The sequence of how the problem happens can be seen in the server.log:

(a) The request is accepted from a remote 61098 client.
[#|2011-12-27T19:05:35.171+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Handling
OP_ACCEPT on SocketChannel java.nio.channels.SocketChannel[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61098]|#]


(b) Sometime later, there is data to be read.
[#|2011-12-27T19:05:35.172+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Handling OP_READ
on SocketChannel java.nio.channels.SocketChannel[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61098]|#]


(c) Later the connection has put to Keepalive management.
[#|2011-12-27T19:05:36.811+0900|INFO|sun-appserver2.1|javax.enterprise.system.


d) Skipping to the time when the connection is closed.

Note:  Take note of the 30 seconds in between, this 30 seconds is also the keepalive default timeout value.  It just so happened that this socket has more data to be read when it was closed due to the Keepalive timed out.


[#|2011-12-27T19:06:06.919+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Handling OP_READ
on SocketChannel java.nio.channels.SocketChannel[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61098]|#]

[#|2011-12-27T19:06:06.919+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Keep-Alive
expired for SocketChannel java.nio.channels.SocketChannel[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61100]|#]

[#|2011-12-27T19:06:06.919+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Closing
SocketChannel java.nio.channels.SocketChanne
l[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61100]|#]

[#|2011-12-27T19:06:06.919+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Keep-Alive
expired for SocketChannel java.nio.channels.SocketChannel[connected
local=/x.x.x.x:8080 remote=/x.x.x.x:61098]|#]

[#|2011-12-27T19:06:06.919+0900|INFO|sun-appserver2.1|javax.enterprise.system.
container.web|_ThreadID=14;_ThreadName=SelectorThread-8080;|Closing
SocketChannel java.nio.channels.SocketChannel[connected local=/x.x.x.x:8080
remote=/x.x.x.x:61098]|#]

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms