Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 20916 invoked from network); 26 Jan 2011 10:23:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jan 2011 10:23:12 -0000 Received: (qmail 50415 invoked by uid 500); 26 Jan 2011 10:23:12 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 50126 invoked by uid 500); 26 Jan 2011 10:23:11 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 49855 invoked by uid 99); 26 Jan 2011 10:23:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jan 2011 10:23:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jan 2011 10:23:05 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0QAMiUU027802 for ; Wed, 26 Jan 2011 10:22:44 GMT Message-ID: <28988083.212081296037364416.JavaMail.jira@thor> Date: Wed, 26 Jan 2011 05:22:44 -0500 (EST) From: "Gary Tully (JIRA)" To: dev@activemq.apache.org Subject: [jira] Assigned: (AMQ-3161) Race condition in ActiveMQ Journal Checkpoint worker thread cleanup leads to multiple running instances In-Reply-To: <6146144.202761295996144742.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Tully reassigned AMQ-3161: ------------------------------- Assignee: Gary Tully > Race condition in ActiveMQ Journal Checkpoint worker thread cleanup leads to multiple running instances > ------------------------------------------------------------------------------------------------------- > > Key: AMQ-3161 > URL: https://issues.apache.org/jira/browse/AMQ-3161 > Project: ActiveMQ > Issue Type: Bug > Components: Message Store > Affects Versions: 5.4.2 > Environment: CentOS 5.2 > Reporter: Craig Condit > Assignee: Gary Tully > Priority: Critical > Attachments: checkpoint-thread.patch > > > 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.