Gustav Trede-2 wrote:
>
> regarding your implementation:
>
> you dont need to flush the data for a notify in onEvent.
> the resume / remove flushes,extra flush splits data into more then needed
> number of tcp packages.
>
> Onterminate should not try to remove the comethandler.
> the onterminate is called after that the handler is removed.
> onInterrupt should not remove the comethandler for similar reason.
>
> In you remove the comethandler instead of resuming for notify, it has side
> effects:
> onTerminate will never be called for that comethandler.
> the connection is leaked, client close and idle detection wont work.
>
> you cant expect any cometcontext.notify to reach a comethandler before you
> know that the handler.onInit has been called .
> the handler is only made active after the servlet request is done.
>
>
Thank you for clarifying that!
I think your last sentence is key to why this happens. I assume by your
response that if the onEvent is triggered before the servlet doPost() has
terminated then the notification will fail (is this documented somewhere?),
and that is what happened in my case.
I have resolved this problem by using a direct synchronous call from my
worker thread instead of using notification.
--
View this message in context: http://www.nabble.com/Grizzly---Comet-concurrency-issue-tp23197357p23258355.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.