dev@jersey.java.net

Re: [Patch} Fix Grizzly timing issue

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 06 Dec 2007 11:26:48 +0100

Paul Sandoz wrote:
> Jeanfrancois Arcand wrote:
>> Salut,
>>
>> attached is a new patch that fix the timing issue when starting
>> Grizzly. You need to update this binary:
>>
>>> http://download.java.net/maven/2/com/sun/grizzly/http/1.6-SNAPSHOT/http-1.6-SNAPSHOT.jar
>>>
>>
>> The diff consists of:
>>
>>> Index:
>>> src/api/com/sun/ws/rest/api/container/grizzly/GrizzlyServerFactory.java
>>> ===================================================================
>>> ---
>>> src/api/com/sun/ws/rest/api/container/grizzly/GrizzlyServerFactory.java
>>> (revision 586)
>>> +++
>>> src/api/com/sun/ws/rest/api/container/grizzly/GrizzlyServerFactory.java
>>> (working copy)
>>> @@ -129,23 +129,7 @@
>>> selectorThread.setPort(port);
>>>
>>> selectorThread.setAdapter(adapter);
>>> - - try {
>>> - selectorThread.initEndpoint();
>>> - } catch (Exception ex) {
>>> - throw new ContainerException(ex);
>>> - }
>>> -
>>> - new Thread() {
>>> - public void run() {
>>> - try {
>>> - selectorThread.startEndpoint();
>>> - } catch (Exception ex) {
>>> - throw new ContainerException(ex);
>>> - }
>>> - }
>>> - }.start();
>>> - + selectorThread.listen(); return
>>> selectorThread;
>>> } -}
>>> \ No newline at end of file
>>
>> Mainly, I've added a new method that take care of initializing
>> everything, spwan the thread and continue :-)
>>
>
> Thanks, that works for every case except one. I can consistently make it
> fail for the test:
>
> HttpMethodTest.testAll
>
> when i run it directly, but not in debug mode, or when i run all the
> unit tests, or when hudson runs them :-)
>
> This does a GET, POST, PUT, DELETE in sequence and it fails on the POST.
> If i put a sleep between the GET and POST it does not.

OK that help...not sure why I've missed that one :-)

>
> However, the case when such failures occur is very much reduced, so
> things are very much improved. I don't want to delay your 1.7.0 release!

:-) Let me try more before giving up on that release :-) Grizzly can
hibernate a couple of more days :-)

Thanks!

-- Jeanfrancois


>
>
>> 1.7.0 official release is coming soon, and that one will be the
>> official one :-)
>>
>
> OK.
>
> Paul.
>
>> Thanks
>>
>> -- Jeanfrancois
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>
>