users@grizzly.java.net

Re: Client Stream Update Issue with Grizzly Comet

From: Abey Tom <appu_abey_tom_at_yahoo.com>
Date: Sat, 25 Apr 2009 00:34:20 -0700 (PDT)

Salut,

I ran into a couple of more issues now.I think these are related to the
above issue. I've created a Java Program to hit the WAR(the same one I
attached in my first mail). Please find the Java File attached. This program
invokes http://www.nabble.com/file/p23229414/CometTest.java CometTest.java
the AjaxCometServlet. I'm also passing a unique clientId as the request
parameter, which i'm logging at both the client-side and server-side.

======Issue 1======
I start the server(grizzly-comet-webserver) and In the client program I
spawned 20 threads and hit the application and then stop the client after
getting some responses. Everything works fine.
Then I just spawned a SINGLE thread and hit the application and found that
the request parameter 'clientId' logged in at the server-side is different
from the one which is passed from the client-side. This server-side clientId
is one of the clientIds which came as part of the first 20 threads.

So in the method GrizzlyAdapter.service(Request, Response), when I inspected
the variable com.sun.grizzly.tcp.Request req, the value of
req.parameters.decodedQuery is the wrong clientId and req.queryMB has been
set to the correct clientId. So request.getParameter("clientId") return the
wrong one(old one from some previous request).

======Issue 2 ======
In this above case also server is not sending any response to the client. So
when I inspected the variable com.sun.grizzly.tcp.Request req in method
GrizzlyAdapter.service(..) , the variable req.errorException is not NULL
which causes ClientAbortException being thrown from the method
com.sun.grizzly.tcp.http11.GrizzlyOutputBuffer.doFlush(boolean).
This method Response.setErrorException(Exception)is bieng invoked when
SocketChannelOutputBuffer.flush() throws IOException when I disconnect the
first 20 threads(terminate the client java program).

How do we make sure that we get new Request() and new Response() each time
we start a new Client Request?

Please feel free to revert if you need any furthur information.

Thanks,
Tom
-- 
View this message in context: http://www.nabble.com/Client-Stream-Update-Issue-with-Grizzly-Comet-tp23211261p23229414.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.