users@grizzly.java.net

Re: CometEngine in 1.0.20 dropping packets

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 04 May 2009 15:53:43 -0400

Salut,

Jeffrey Kesselman wrote:
> Sure, but if you want a simpel case I may have to strip it down some.
>
> As is its part of a moderately (but nto extremely) complicated system
> thats a generic message framework we're building.

Great! One thing you can take a look at is usually the issue happens
because the CometHandler gets resumed inside an onEvent(), but a
push/notify happens at the same time and the onEvent gets invoked again
with an "invalid/resumed" CometHandler. One way to track that is to call
CometContext.isActive(cometHandler)...but It may not be related to your
issue :-)

Thanks!

-- Jeanfrancois

>
> JK
>
> On Mon, May 4, 2009 at 1:25 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand_at_sun.com> wrote:
>> Salut,
>>
>> can you share a test case? If you can't share it public, drop me an email at
>> jfarcand_at_apache.org
>>
>> Thanks!
>>
>> -- Jeanfrancois
>>
>> Jeffrey Kesselman wrote:
>>> Unfortunately, it didn't help :/
>>>
>>> Still the same behavior. I do the two notifies one right after the other
>>> and the second one is dropped silently.
>>> I put a 500ms sleep ebwteen the two and it works.
>>>
>>> Both states are 100% reproducible.
>>>
>>> JK
>>> On May 4, 2009, at 12:44 PM, Jeffrey Kesselman wrote:
>>>
>>>> Hi JeanFrancois
>>>>
>>>> Thanks for the quick answer. I have my onEvent synchronized already.
>>>> (Tried that first thing to make sure it
>>>> wasn't MY race somehow :) )
>>>>
>>>> I'll try CometContext.setBlockingNotification(true)
>>>>
>>>> Thanks
>>>>
>>>> JK
>>>>
>>>>
>>>>> Salut,
>>>>>
>>>>> Jeffrey Kesselman wrote:
>>>>>> Hey Guys,
>>>>>>> I've run into what seems to be a clear race condition. I have two
>>>>>>> calls > to notify in a row in my code. (One is a READ type the other is a
>>>>>>>> Notify type).
>>>>>> When they occur immediately right after each other, the second packet
>>>>>> is > silently dropped. if i put a 500 ms sleep between them, they work
>>>>>> fine.
>>>>>>> is this a known race condition? Are there known work arounds other
>>>>>>> then > the evil sleep?
>>>>> If you synchronize your onEvent method, does it help? Another workaround
>>>>> is to call CometContext.setBlockingNotification(true)....but I would try
>>>>> first with sync to see if that help.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> -- Jeanfrancois
>>>>>
>>>>>
>>>>
>>>>
>
>
>