users@grizzly.java.net

From Grizzly 1.9.x to 2.x

From: Gay David (Annecy) <"Gay>
Date: Wed, 3 Aug 2011 14:33:27 +0000

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