Red Hat Bugzilla – Bug 997890
consumer.receive() thows IndexOutOfBoundException in standalone JMS client
Last modified: 2014-10-25 08:01:33 EDT
Description of problem:
IndexOutOfBoundException crashed standalone JMS client in one of failover tests for replicated journal.
This can have negative impact to customer's production environment.
1. Start two EAP 6.1.1.ER6 in colocated topology with replicated journal
2. Start publishers and one subscriber sending/receiving messages to/from topic
3. Kill first server
4. Wait for failover to occur
5. Start first server again
6. Wait for failback
7. Stop publishers and wait for subcriber to read all messages
In step 7. IndexOutOfBoundException was thrown to subscriber :
03:39:04,654 Thread-253 ERROR [org.jboss.qa.hornetq.apps.clients.SubscriberTransAck:138] Exception was thrown during receiving messages:
java.lang.IndexOutOfBoundsException: Not enough readable bytes - Need 409600, maximum is 204795
Client is receiving mix of small and large messages of various types (Stream, Object, Byte, Text and Map messages). Exception was thrown after succesful failback of client from backup to live during receiving large TextMessage with body of size 400KB.
This issue appeared only once. There is no reproducer.
It seems you just need a retry mechanism on the client for large messages...
I would mark this as a wont-fix or works for me.. I have no substantial information to work here
thanks for your feedback.
There is IndexOutOfBoundException thrown from consumer.receive() method which is unexpected and unchecked. Consumer can retry receive only if JMSException is thrown.
In this case buffer for receiving large message was not allocated properly.
From the log it appears that IndexOutOfBoundException is not related to failover/failback scenario. It was thrown when no kind of server failure was in progress. Subscriber is using transacted session and commits every 100th message.
I could not replicate the issue but I suspect that certain sequence of large and small messages can lead to this exception.
We should not close this bz.
Adding updated link to "raw" log from jenkins job:
Closing as I don't see IndexOutOfBoundException any more.