users@glassfish.java.net

Re: Unclear definitions of HTTP listener settings

From: <forums_at_java.net>
Date: Mon, 24 Oct 2011 05:31:18 -0500 (CDT)

> It has to be client side, who reissues the request.

Well, yes and no. It appears that it's the browser that reissues the
request, BUT it does not do it on its own initiative.

In other words, it's not because of any time-out in the browser.

I played around with the Glassfish setting "Request Timeout". I set it to 60
s, and made a request to my "thread sleep for ten hours" servlet.

After exactly 60 seconds, Glassfish times out and interrupts the thread,
which then logs and exits (as it should).

Glassfish also sends back a 200 response, which causes the browser (eg FF,
IE) sends a NEW identical request! A new thread is started at the server.

After exactly another 60 seconds, Glassfish time out and interrupts the
thread, which then logs and exists (as it should).

Glassfish also sends back another 200 response, but THIS time the browser
does not send any new request. It just gives up, stops the rotating
widget, and shows a blank page.

If I kill the browser after the first request is sent, no additional request
reaches the server.

Here follows my homebrew request/response log. It shows the events described
above, first with the browser re-sending the request, then with the browser
killed after the first request.

---
2011-10-24 11:51:50,801 5e per  GET  --> /adm [op=black-hole]
2011-10-24 11:51:50,801 5e per  Headers: [host=localhost:8181]
[user-agent=Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101
Firefox/7.0.1]
[accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
[accept-language=en-us,en;q=0.5] [accept-encoding=gzip, deflate]
[accept-charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7] [connection=keep-alive]
[cookie=login=true; JSESSIONID=557b684c6bbfc062bd6b71d3425e;
JSESSIONID=4faec9c1ed5169fe0c0dcd68b0a1;
treeForm_tree-hi=treeForm:tree:configurations:server-config:networkConfig:protocols:http-listener-2]
2011-10-24 11:52:50,801 5e per  <--  200 /adm [op=black-hole]
2011-10-24 11:52:50,801 5e per  Headers: [X-Powered-By=JSP/2.2]
[Server=GlassFish Server Open Source Edition 3.1] [Pragma=No-cache]
[Cache-Control=no-cache] [Expires=Thu, 01 Jan 1970 01:00:00 CET]
[Content-Type=text/html;charset=UTF-8] [Transfer-Encoding=chunked] [Date=Mon,
24 Oct 2011 09:52:50 GMT]
2011-10-24 11:52:50,816 5e per  GET  --> /adm [op=black-hole]
2011-10-24 11:52:50,816 5e per  Headers: [host=localhost:8181]
[user-agent=Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101
Firefox/7.0.1]
[accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
[accept-language=en-us,en;q=0.5] [accept-encoding=gzip, deflate]
[accept-charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7] [connection=keep-alive]
[cookie=login=true; JSESSIONID=557b684c6bbfc062bd6b71d3425e;
JSESSIONID=4faec9c1ed5169fe0c0dcd68b0a1;
treeForm_tree-hi=treeForm:tree:configurations:server-config:networkConfig:protocols:http-listener-2]
2011-10-24 11:53:51,816 5e per  <--  200 /adm [op=black-hole]
2011-10-24 11:53:51,816 5e per  Headers: [X-Powered-By=JSP/2.2]
[Server=GlassFish Server Open Source Edition 3.1] [Pragma=No-cache]
[Cache-Control=no-cache] [Expires=Thu, 01 Jan 1970 01:00:00 CET]
[Content-Type=text/html;charset=UTF-8] [Transfer-Encoding=chunked] [Date=Mon,
24 Oct 2011 09:53:51 GMT]
2011-10-24 11:55:04,722 5e per  GET  --> /adm [op=black-hole]
2011-10-24 11:55:04,722 5e per  Headers: [host=localhost:8181]
[user-agent=Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101
Firefox/7.0.1]
[accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
[accept-language=en-us,en;q=0.5] [accept-encoding=gzip, deflate]
[accept-charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7] [connection=keep-alive]
[cookie=login=true; JSESSIONID=557b684c6bbfc062bd6b71d3425e;
JSESSIONID=4faec9c1ed5169fe0c0dcd68b0a1;
treeForm_tree-hi=treeForm:tree:configurations:server-config:networkConfig:protocols:http-listener-2]
2011-10-24 11:56:04,738 5e per  <--  200 /adm [op=black-hole]
2011-10-24 11:56:04,738 5e per  Headers: [X-Powered-By=JSP/2.2]
[Server=GlassFish Server Open Source Edition 3.1] [Pragma=No-cache]
[Cache-Control=no-cache] [Expires=Thu, 01 Jan 1970 01:00:00 CET]
[Content-Type=text/html;charset=UTF-8] [Transfer-Encoding=chunked] [Date=Mon,
24 Oct 2011 09:56:04 GMT]
---
I guess the question is: what makes the browser re-issue the request? The
response is a 200, which should not cause such behavior in any browser.
 
--
[Message sent by forum member 'tmpsa']
View Post: http://forums.java.net/node/855551