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

Message loss when server is killed during msg.acknowledge()

    Details

    • Release Notes Docs Status:
      Not Required
    • Docs QE Status:
      NEW

      Description

      When server is killed when HornetQ server stored ack to journal but did not finish QueueImpl.postDeliver() method then message is lost.

      Test scenario:

      1. Start EAP server with HornetQ and queue InQueue
      2. Install byteman script [1] - "kill server when x-th message is being acknowledge"
      3. Send messages to InQueue
      4. Read messages from InQueue with standalone client using CLIENT_ACKNOWLEDGE mode for session (each message is acknowledged)
      5. Restart server
      6. Read rest of messages

      Result:
      1 message is not delivered
      client gets exception from msg.acknowledge() and ends

      Byteman script:

      RULE setup counter
      CLASS org.hornetq.core.server.impl.QueueImpl
      METHOD <init>
      AT EXIT
      IF TRUE
      DO createCounter("counter")
      ENDRULE

      RULE info about incrementing counter
      CLASS org.hornetq.core.server.impl.QueueImpl
      METHOD postAcknowledge
      AT INVOKE org.hornetq.core.persistence.StorageManager.deleteMessage(long)
      IF TRUE
      DO incrementCounter("counter");
      System.out.println("Called acknowledge message - kill between - ack saved to journal (commited) and deletion of message " + readCounter("counter"))
      ENDRULE

      RULE kill on receive
      CLASS org.hornetq.core.server.impl.QueueImpl
      METHOD postAcknowledge
      AT INVOKE org.hornetq.core.persistence.StorageManager.deleteMessage(long)
      IF readCounter("counter")>123
      DO System.out.println("Byteman invoked"); killJVM();
      ENDRULE

      It seems to be a quality issue for our HornetQ component.

      Thank you,

      Mirek

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                clebert.suconic Clebert Suconic
                Reporter:
                mnovak Miroslav Novak
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: