Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-6110

Server Shutdown will cause LargeMessage Consuming to throw IndexOutOfBoundsException instead of some IO Exception

XMLWordPrintable

      Hi Clebert,
      I hit following issue with large messages. Client receives IndexOutOfBoundsException and I am missing one message on the end of the test.

      Test scenario:
      1. Start server and push 1000 large messages (each message has 1 MB)
      2. Start receive large messages with standalone client
      3. Stop server (clean shutdown) while client receives messages << IndexOutOfBoundsException occurs here
      4. Restart server and consume all messages

      Client hits following exception:

      java.lang.IndexOutOfBoundsException
      	at org.jboss.netty.buffer.AbstractChannelBuffer.checkReadableBytes(AbstractChannelBuffer.java:657)
      	at org.jboss.netty.buffer.AbstractChannelBuffer.readBytes(AbstractChannelBuffer.java:337)
      	at org.jboss.netty.buffer.AbstractChannelBuffer.readBytes(AbstractChannelBuffer.java:343)
      	at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readSimpleStringInternal(ChannelBufferWrapper.java:84)
      	at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readNullableSimpleString(ChannelBufferWrapper.java:58)
      	at org.hornetq.jms.client.HornetQTextMessage.doBeforeReceive(HornetQTextMessage.java:143)
      	at org.hornetq.jms.client.HornetQMessageConsumer.getMessage(HornetQMessageConsumer.java:238)
      	at org.hornetq.jms.client.HornetQMessageConsumer.receive(HornetQMessageConsumer.java:133)
      	at org.jboss.smartfrog.hornetq.SimpleReceiver.receiveMessage(SimpleReceiver.java:286)
      	at org.jboss.smartfrog.hornetq.SimpleReceiver.clientLogic(SimpleReceiver.java:188)
      	at org.jboss.smartfrog.hornetq.AJMSClient.run(AJMSClient.java:277)
      	at java.lang.Thread.run(Thread.java:619)
      

      I have found similar problem with Netty [1] with streamed data. Does HQ implementation contains required workarounds for this problem as it is described in [2]? Please check implementation of org.hornetq.core.buffers.impl.ChannelBufferWrapper.

      This issue does not occur every run of automated test and it is quite hard to simulate/hit it. For this reason there is no simple reproducer attached.

      [1] http://stackoverflow.com/questions/3232588/weird-indexoutofbound-erro-from-nettys-channelbuffer-read
      [2] http://docs.jboss.org/netty/3.2/guide/html/start.html#d0e794

      Thank you.

              csuconic@redhat.com Clebert Suconic
              pslavice@redhat.com Pavel Slavicek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: