Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA49010F19 for ; Tue, 3 Sep 2013 20:24:38 +0000 (UTC) Received: (qmail 33174 invoked by uid 500); 3 Sep 2013 20:24:38 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 33149 invoked by uid 500); 3 Sep 2013 20:24:38 -0000 Mailing-List: contact commits-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 commits@activemq.apache.org Received: (qmail 33142 invoked by uid 99); 3 Sep 2013 20:24:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 20:24:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 532908C749A; Tue, 3 Sep 2013 20:24:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtully@apache.org To: commits@activemq.apache.org Message-Id: <08af8e10b09742a8b6d966c29c92fb75@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: https://issues.apache.org/jira/browse/AMQ-4705 - add check for lock file exist and use error in place of warn if lock is lost Date: Tue, 3 Sep 2013 20:24:38 +0000 (UTC) Updated Branches: refs/heads/trunk d2f4d76f8 -> 74b35bc5d https://issues.apache.org/jira/browse/AMQ-4705 - add check for lock file exist and use error in place of warn if lock is lost Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/74b35bc5 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/74b35bc5 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/74b35bc5 Branch: refs/heads/trunk Commit: 74b35bc5dd75edb9d9e3250a4362b85d78023d76 Parents: d2f4d76 Author: gtully Authored: Tue Sep 3 21:22:20 2013 +0100 Committer: gtully Committed: Tue Sep 3 21:24:09 2013 +0100 ---------------------------------------------------------------------- .../java/org/apache/activemq/broker/LockableServiceSupport.java | 2 +- .../src/main/java/org/apache/activemq/util/LockFile.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/74b35bc5/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java b/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java index f47b773..2475201 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java @@ -131,7 +131,7 @@ public abstract class LockableServiceSupport extends ServiceSupport implements L protected void stopBroker() { // we can no longer keep the lock so lets fail - LOG.info(brokerService.getBrokerName() + ", no longer able to keep the exclusive lock so giving up being a master"); + LOG.error(brokerService.getBrokerName() + ", no longer able to keep the exclusive lock so giving up being a master"); try { if( brokerService.isRestartAllowed() ) { brokerService.requestRestart(); http://git-wip-us.apache.org/repos/asf/activemq/blob/74b35bc5/activemq-broker/src/main/java/org/apache/activemq/util/LockFile.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/util/LockFile.java b/activemq-broker/src/main/java/org/apache/activemq/util/LockFile.java index ace6181..8fe512a 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/util/LockFile.java +++ b/activemq-broker/src/main/java/org/apache/activemq/util/LockFile.java @@ -140,7 +140,7 @@ public class LockFile { } public boolean keepAlive() { - return lock != null && lock.isValid(); + return lock != null && lock.isValid() && file.exists(); } }