users@grizzly.java.net

RE: From Grizzly 1.9.x to 2.x

From: Gay David (Annecy) <"Gay>
Date: Thu, 4 Aug 2011 08:43:46 +0000

Hi Alexey,

Please forget the problem.
I'm really sorry, but I found some errors in my crappy test case code, don't lose time on it.

One remark : on my application code, as I say, I had some errors in unit tests. But it seems to be fix now. What I have done is to modify how I call the method Response.suspend() :

Before was :

res.suspend( Long.MAX_VALUE, TimeUnit.MINUTES, mycompletion );
Gives me theses kind of errors : java.lang.IllegalStateException: Internal org.glassfish.grizzly.http.server.Response has not been set


And now if I do :

res.suspend( -1, TimeUnit.MINUTES, mycompletion );
It seems to be ok

I still need to push further my test to be completely sure of course
Could it be a cause of a problem in Gz ? Do you want me to try to reproduce on a simple test case ?

Thanks for your help
Regards
David

De : Oleksiy Stashok [mailto:oleksiy.stashok_at_oracle.com]
Envoyé : mercredi 3 août 2011 16:58
À : users_at_grizzly.java.net
Objet : Re: From Grizzly 1.9.x to 2.x

Hi David,

I'll check the exception, but anyway it happens during server shutdown, so it doesn't have to affect the actual run.

WBR,
Alexey.

On 08/03/2011 04:33 PM, Gay David (Annecy) wrote:
Hi all,

I'm trying to experiment Grizzly 2 by porting my current application from 1.9.x to 2.x.

Basically I'm assuming that the default Grizzly behavior is the same to do long request :

* Suspend the response
* Give the processing of the request/response to my own thread pool
* Once finish, resume it

Am I wrong ?

So my first step is to convert all my code that use Gz 1.9 API to Gz 2.0 API (package change, etc.) and check how it works (and also check if it's fix some problems I have under heavy load).

The second step would be later to use new functionality of Gz 2.0

So I've done the first step, but I'm block on some units test that simulate some heavy upload/download. (unit tests that went ok with Gz 1.9.x)


I've made a simple test case to illustrate my problem. This test simulate uploads, but I still have to same problem with download.
I've add it in attachement, it's a simple Maven project.

At the end of the (long) test, I've many exception like :

java.lang.IllegalStateException: Internal org.glassfish.grizzly.http.server.Response has not been set
        at org.glassfish.grizzly.http.server.Response.checkResponse(Response.java:1607)
        at org.glassfish.grizzly.http.server.Response.setStatus(Response.java:1255)
        at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:202)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:162)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:160)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$3.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:444)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:364)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:290)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:76)
        at org.glassfish.grizzly.filterchain.FilterChainContext$1.run(FilterChainContext.java:198)
        at org.glassfish.grizzly.filterchain.FilterChainContext.resume(FilterChainContext.java:222)
        at org.glassfish.grizzly.http.server.Response.cancel(Response.java:1599)
        at org.glassfish.grizzly.http.server.Response$SuspendedContextImpl.onClosed(Response.java:1717)
        at org.glassfish.grizzly.nio.NIOConnection.notifyCloseListeners(NIOConnection.java:612)
        at org.glassfish.grizzly.nio.NIOConnection.close(NIOConnection.java:358)
        at org.glassfish.grizzly.nio.NIOConnection.close(NIOConnection.java:349)
        at org.glassfish.grizzly.nio.SelectorRunner.shutdownSelector(SelectorRunner.java:210)
        at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:286)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:508)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:488)
        at java.lang.Thread.run(Thread.java:662)

Could someone helps me to check if I do something wrong, or if it's a Gz 2.x problem.

BTW : I'm using Grizzly 2.1.1

Thanks and regards
David