Uploaded image for project: 'HornetQ'
  1. HornetQ
  2. HORNETQ-1142

Race condition between reaper thread and server start

    XMLWordPrintable

    Details

      Description

      If the server hasn't started by the time the message reaper thread runs exceptions like this will be thrown:

      2013-02-21 08:29:40,906 WARN  [org.hornetq.core.server.impl.QueueImpl] (Thread-82 (HornetQ-server-HornetQServerImpl::serverUUID=6c8f13fd-5393-11e2-93f6-0017a477010e-1071650949)) Error expiring reference PagedReferenceImpl [position=PagePositionImpl [pageNr=8, messageNr=0, recordID=-1], message=PagedMessageImpl [queueIDs=[15080417715, 21648165158, 22092553903, 15048631152, 21583469412, 617, 15045830618, 15051604556], transactionID=-1, message=ServerMessage[messageID=22454389933,priority=4, bodySize=51200,expiration=Tue Feb 19 00:52:19 EST 2013, durable=true, address=jms.topic.PUT_TEST3_SECREF_NOTIFY_ISSUER_UPDATE,properties=TypedProperties[{CLIENTID=PACE.SECURITY.PUB}]]@1804048270], deliveryTime=0, persistedCount=0, deliveryCount=0, subscription=PageSubscriptionImpl [cursorId=15080417715, queue=QueueImpl[name=LZMINERVA\.LZSECURITY\.0.LZMINERVA\.LZSECURITY\.0\.cn=PUT_TEST3\.SECREF\.NOTIFY\.ISSUER\.UPDATE\.LZMINERVA, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=6c8f13fd-5393-11e2-93f6-0017a477010e]]@3e1dfb2, filter = null]]
      java.lang.IllegalStateException: Journal must be loaded first
      	at org.hornetq.core.journal.impl.JournalImpl.appendAddRecordTransactional(JournalImpl.java:1052)
      	at org.hornetq.core.persistence.impl.journal.JournalStorageManager.storeMessageTransactional(JournalStorageManager.java:647)
      	at org.hornetq.core.postoffice.impl.PostOfficeImpl.processRoute(PostOfficeImpl.java:1017)
      	at org.hornetq.core.postoffice.impl.PostOfficeImpl.route(PostOfficeImpl.java:679)
      	at org.hornetq.core.postoffice.impl.PostOfficeImpl.route(PostOfficeImpl.java:576)
      	at org.hornetq.core.server.impl.QueueImpl.move(QueueImpl.java:2125)
      	at org.hornetq.core.server.impl.QueueImpl.expire(QueueImpl.java:991)
      	at org.hornetq.core.server.impl.QueueImpl$6.run(QueueImpl.java:1322)
      	at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      

      This will result in expired messages being acked (i.e. removed) but the expired messages will not make it to the expiry address (assuming one is configured)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                clebert.suconic Clebert Suconic
                Reporter:
                jbertram Justin Bertram
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: