users@grizzly.java.net

Re: grizzly-comet-webserver gets stuck sometime while processing request

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 15 Jun 2009 11:42:05 -0400

Salut,

Abey Tom wrote:
> Hi
>
> Some times my server grizzly-comet-webserver-1.9.17-SNAPSHOT gets stuck
> while processing the request.
>
> Test Case Scanario:
> The client i'm using is the sample application from the trunk, comet-chat. I
> open a browser window(index.html) and then keep on hitting the refresh
> button in the browser. The browser hangs(waiting for resource from server)
> after some hits. Pls find the screenshot of browser.
> http://www.nabble.com/file/p24033280/stuck_request.jpg stuck_request.jpg
>
> I i'm using the latest trunk code (1.9.17-SNAPSHOT, rev 3321). I have tested
> on my desktop(win XP 32 bit single core) and server class machine (4 cpu,64
> bit, linux). The chances of reproducing the issue in SERVER is MORE than in
> my desktop.
>
> Please find the attached thread dump when the server is stuck.
> http://www.nabble.com/file/p24033280/stuck_threaddump.txt
> stuck_threaddump.txt .
>
> One (strange??) thing I have noticed is that if I put a sleep in as follows
> I'm not able to reproduce this issue.
>
>
> method DefaultThreadPool.execute(Runnable){
> ....
> if (running){
> try {
> Thread.sleep(5);
> } catch {....}
> workQueue.offer(task);
> queueSize.incrementAndGet();
> }
> }
>
>
> To debug I have added some sysout statements in the following parts.
>
> method DefaultThreadPool.execute(Runnable){
> ....
> if (running){
> System.out.println("DefaultThreadPool.execute()"+" ,
> "+System.nanoTime()+","+Thread.currentThread().getName()
> + " , Offer , "+ task);
> workQueue.offer(task);
> queueSize.incrementAndGet();
> }
> }
>
> method FixedThreadPool.BasicWorker.dowork(){
> .......
> Runnable r = getTask();
>
> System.out.println("FixedThreadPool.BasicWorker.dowork()"+" ,
> "+System.nanoTime()+","+Thread.currentThread().getName()+" , Take , "+r);
> if (r == poison || r == null){
> return;
> }
> ......
> }
>
>
> Please find the sysout messages both in the normal case(not stuck) and stuck
> case. I have the results in csv format.
>
> Normal(not stuck) sysout messages :
> http://www.nabble.com/file/p24033280/normal.csv normal.csv
> Stuck sysout Messages : http://www.nabble.com/file/p24033280/stuck.csv
> stuck.csv
>
> Here the number of invocations of the workQueue.take() and workQueue.offer()
> in a stuck request will be less than in the case of normal request.
>
> Kindly Look into this.
> Please let me know if any other details are required to reproduce this
> issue.

Thanks. I've filled:

https://grizzly.dev.java.net/issues/show_bug.cgi?id=670

to track the issue.

A+

-- jeanfrancois



>
> Thanks,
> Abey Tom.
>
>
>
>
>
>
>
>
>