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 2488E103FA for ; Thu, 5 Dec 2013 14:58:16 +0000 (UTC) Received: (qmail 15781 invoked by uid 500); 5 Dec 2013 14:58:15 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 15697 invoked by uid 500); 5 Dec 2013 14:58:10 -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 15688 invoked by uid 99); 5 Dec 2013 14:58:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Dec 2013 14:58:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 53FED81B5A6; Thu, 5 Dec 2013 14:58:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chirino@apache.org To: commits@activemq.apache.org Message-Id: <096a051d75924e548c118eaaa82190f8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Implementing a dirty stop method for the leveldb store that might come in handy for testing. Date: Thu, 5 Dec 2013 14:58:09 +0000 (UTC) Updated Branches: refs/heads/trunk 7cf5c240a -> 3b5fa4bf8 Implementing a dirty stop method for the leveldb store that might come in handy for testing. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/3b5fa4bf Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/3b5fa4bf Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/3b5fa4bf Branch: refs/heads/trunk Commit: 3b5fa4bf8955f15dd1f52703c7578a054beb74e6 Parents: 7cf5c24 Author: Hiram Chirino Authored: Thu Dec 5 09:23:26 2013 -0500 Committer: Hiram Chirino Committed: Thu Dec 5 09:24:10 2013 -0500 ---------------------------------------------------------------------- .../scala/org/apache/activemq/leveldb/LevelDBClient.scala | 10 +++++++++- .../leveldb/replicated/ElectingLevelDBStore.scala | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/3b5fa4bf/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala ---------------------------------------------------------------------- diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala index 7872ff8..44f0d44 100755 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala @@ -971,7 +971,15 @@ class LevelDBClient(store: LevelDBStore) { } } - def stop() = this.synchronized { + def dirty_stop = this.synchronized { + def ingorefailure(func: =>Unit) = try { func } catch { case e:Throwable=> } + ingorefailure(index.close) + ingorefailure(log.close) + ingorefailure(plist.close) + ingorefailure(might_fail(throw new IOException("non-clean close"))) + } + + def stop():Unit = this.synchronized { if( writeExecutor!=null ) { writeExecutor.shutdown writeExecutor.awaitTermination(60, TimeUnit.SECONDS) http://git-wip-us.apache.org/repos/asf/activemq/blob/3b5fa4bf/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala ---------------------------------------------------------------------- diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala index 90e80c0..55e0419 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala @@ -243,6 +243,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore { master_stopped.set(true) position = master.wal_append_position stopped_latch.countDown() + master = null func }) master.blocking_executor.execute(^{