users@glassfish.java.net

Re: Unclear definitions of HTTP listener settings

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Thu, 27 Oct 2011 16:04:41 +0200

I'm not sure what's your servlet doing.
Can you pls. try this one:

public class RequestTimeoutServlet extends HttpServlet {

     protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
             throws ServletException, IOException {

         System.out.println("sleeping 120 secs");
         try {
             Thread.sleep(120000);
         } catch (InterruptedException e) {
             e.printStackTrace();
         } finally {
             System.out.println("woke up");
         }

         response.getWriter().print("Works");
     }

     @Override
     protected void doGet(HttpServletRequest request,
HttpServletResponse response)
             throws ServletException, IOException {
         processRequest(request, response);
     }

     @Override
     protected void doPost(HttpServletRequest request,
HttpServletResponse response)
             throws ServletException, IOException {
         processRequest(request, response);
     }
}


WBR,
Alexey.

On 10/27/2011 03:48 PM, forums_at_java.net wrote:
> I have now upgraded my Glassfish from 3.1 to 3.1.1, and replaced
> ...glassfish/modules/grizzly-hhtp.jar with your patched version.
>
> It did not help. It got even worse!
>
> In fact, Glassfish 3.1 makes ONE reattempt and Glassfish 3.1.1 makes TWO
> reattempt, and with your patch it makes THREE reattempts.
>
> Here's what I did:
>
> 1. Set Request Timeout to 10 s
>
> 2. Try my "black hole" servlet.
>
> 3. Stop Glassfish
>
> 4. Install your patched grizzly-hhtp.jar to ...glassfish/modules
>
> 5. Start Glassfish
>
> 6. Try my "black hole" servlet.
>
> Here is the output from my homebrew RequestLogFilter.
>
> Before:
>
> 2011-10-27 15:19:11,203 5e per GET --> /adm [op=black-hole]
> 2011-10-27 15:19:21,203 5e per GET --> /adm [op=black-hole]
> 2011-10-27 15:19:21,203 5e per <-- 200 /adm [op=black-hole]
> 2011-10-27 15:19:31,203 5e per GET --> /adm [op=black-hole]
> 2011-10-27 15:19:31,203 5e per <-- 200 /adm [op=black-hole]
> 2011-10-27 15:19:41,203 5e per <-- 200 /adm [op=black-hole]
>
> After:
>
> 2011-10-27 15:28:39,109 78 per GET --> /adm [op=black-hole]
> 2011-10-27 15:28:49,109 78 per GET --> /adm [op=black-hole]
> 2011-10-27 15:28:49,125 78 per <-- 200 /adm [op=black-hole]
> 2011-10-27 15:28:59,125 78 per GET --> /adm [op=black-hole]
> 2011-10-27 15:28:59,125 78 per <-- 200 /adm [op=black-hole]
> 2011-10-27 15:29:09,125 78 per GET --> /adm [op=black-hole]
> 2011-10-27 15:29:09,125 78 per <-- 200 /adm [op=black-hole]
> 2011-10-27 15:29:19,125 78 per <-- 200 /adm [op=black-hole]
>
>
> After switching back to the plain vanilla grizzly-http.jar, I still
> see THREE
> reattempts in my request log file.
>
>
>
>
> --
>
> [Message sent by forum member 'tmpsa']
>
> View Post: http://forums.java.net/node/855551
>
>