dev@grizzly.java.net

Re: Issue No. 534

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Mon, 27 Apr 2009 10:43:59 +0200

Hi Minoru,

>
> I tested my program with grizzly-
> framework-1.9.15-20090423.170629-3.jar
> and grizzly-utils-1.9.15-20090423.170629-3.jar. Unfortunately the
> result
> was as same as before. I investigated the problem a little, and I
> found
> out that instance of SelectionKeyContextTask was actually a
> CallbackHandlerContextTask.
May be fix is not there. I made change on 24.04.2009
"
Author: oleksiys
Date: 2009-04-24 15:18:20+0000
New Revision: 3055

Modified:
   trunk/code/modules/grizzly/src/main/java/com/sun/grizzly/
ContextTask.java

Log:
fix NPE

https://grizzly.dev.java.net/source/browse/grizzly/trunk/code/modules/grizzly/src/main/java/com/sun/grizzly/ContextTask.java?view=diff&rev=3055&p1=trunk/code/modules/grizzly/src/main/java/com/sun/grizzly/ContextTask.java&p2=trunk/code/modules/grizzly/src/main/java/com/sun/grizzly/ContextTask.java&r1=3054&r2=3055



> CallbacHandlerContextTask is executed in a separate thread in
> principle.
> So I think SelectionKeyContextTask.call method must be thread safe
> (synchronized method). I modified the source code of Grizzly and
> tested it,
> then, NullPointerException did not occur.
>
> Does this make sense?
Yes, though we need to avoid synchronized, where it's possible. The
problem I've fixed is that we returned Context to pool and only then
recycled it. That's why, I expect, NPE was thrown.

Thank you.

WBR,
Alexey.

>
>
> Thanks,
>
> Minoru
>
>> Hi Minoru,
>>
>> can you pls. try the latest 1.9.15 built from sources (cause I'm not
>> sure when snapshot will become available on maven)
>>
>> WBR,
>> Alexey.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>