Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3161

Race condition in ActiveMQ Journal Checkpoint worker thread cleanup leads to multiple running instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 5.4.2
    • 5.5.0
    • Message Store
    • None
    • CentOS 5.2

    • Patch Available

    Description

      If the ActiveMQ Journal Checkpoint worker thread dies for any reason, any updates to KahaDB trigger the thread to be restarted. Unfortunately, there is a race condition between the Thread.isAlive() check and the restart of the thread, potentially leading to multiple instances of the thread being spawned. We have observed in a busy environment as many as 8-10 instances of this thread, all waking up every 5 seconds to perform database checkpoints, bringing throughput on the broker to a halt.

      The attached patch adds a lock around access to creation/destruction of this thread and prevents a second instance from being launched inadvertently.

      Attachments

        1. checkpoint-thread.patch
          5 kB
          Craig Condit

        Issue Links

          Activity

            People

              gtully Gary Tully
              ccondit Craig Condit
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: