Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcknowledgedMessagesSessionExtension - java.lang.ArrayIndexOutOfBoundsException in BatchArrayQueue.clearToBatch #596

Open
sbordet opened this issue Jul 1, 2015 · 7 comments

Comments

@sbordet
Copy link
Member

@sbordet sbordet commented Jul 1, 2015

When we have multiple notifications (about 300) send form server to client (2 different browsers) - then we spot that after sending some of them we see the ArrayIndexOutOfBounds exceptions in Java code:
{quote}
11:46:10,061 INFO org.cometd.bayeux.server.ServerSession Exception while invoking listener org.cometd.server.ext.AcknowledgedMessagesSessionExtension@7d12b538: java.lang.ArrayIndexOutOfBoundsException: 16
at org.cometd.server.ext.BatchArrayQueue.exportMessagesToBatch(BatchArrayQueue.java:159) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.ext.AcknowledgedMessagesSessionExtension.deQueue(AcknowledgedMessagesSessionExtension.java:127) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.ServerSessionImpl.notifyDeQueue(ServerSessionImpl.java:487) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.ServerSessionImpl.takeQueue(ServerSessionImpl.java:468) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.transport.AbstractHttpTransport.flush(AbstractHttpTransport.java:331) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.transport.AbstractHttpTransport.resume(AbstractHttpTransport.java:346) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.transport.AbstractStreamHttpTransport.process(AbstractStreamHttpTransport.java:82) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.transport.AbstractStreamHttpTransport.handle(AbstractStreamHttpTransport.java:52) [cometd-java-server-3.0.4.jar:]
at org.cometd.server.CometDServlet.service(CometDServlet.java:102) [cometd-java-server-3.0.4.jar:]
{quote}

Please also see screen from debugger attached.

If you need more information don't hesitate to ask.

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 1, 2015

Originally reported by john_rambo on 2015-07-01T04:23:31Z

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 6, 2015

sbordet on 2015-07-06T01:09:56Z:
Your screenshot shows that batches is a long[16] with all values set to 0.
This would be ok if the BatchArrayQueue has just been created, or if is empty.
However, it also shows that the size of the queue is 9, so there is something really wrong here.

Can you reproduce the issue in a test case ?

The message acknowledge extension has been tested under high load conditions, and I have never seen this error, but it's always possible you hit an edge case, so it will be really great if you can reproduce the issue.

Can you enable DEBUG logging for AcknowledgedMessagesSessionExtension ?

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 9, 2015

maroos on 2015-07-09T07:20:54Z:
Hi, thanks for the update. Paweł (aka john_rambo) is on holidays right now - I'll try to look into it some time next week and provide an update.

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 21, 2015

john_rambo on 2015-07-21T08:33:57Z:
DEBUG log for AcknowledgedMessagesSessionExtension

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 21, 2015

john_rambo on 2015-07-21T08:37:39Z:
Hi, I've attached logs for AcknowledgedMessagesSessionExtension and also for org.cometd.bayeux.server.ServerSession (it seems strange for me that exception is logged at INFO level and not ERROR level in org.cometd.bayeux.server.ServerSession - see logs attached there is INFO). I hope that this can help. If any further information is needed I will try to provide more data.

@sbordet
Copy link
Member Author

@sbordet sbordet commented Jul 28, 2015

squiddle on 2015-07-28T09:53:41Z:
i cannot tell if this is related, but i can see this error if i am using jetty-9.3.1.v20150714 with cometd 3.0.5.
It does not happen if i use the cometd 3.0.5 jetty version (jetty-9.2.12.v20150709)

@sbordet
Copy link
Member Author

@sbordet sbordet commented Aug 5, 2015

sbordet on 2015-08-05T02:28:08Z:
CometD 3.0.x works with Jetty 9.2.x.

CometD 3.1.x works with Jetty 9.3.x.

I suggest you stick with the recommended pairings, although this issue will be investigated in CometD 3.1.

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.