mirror of https://github.com/apache/activemq.git
Implementing a dirty stop method for the leveldb store that might come in handy for testing.
This commit is contained in:
parent
7cf5c240a2
commit
3b5fa4bf89
|
@ -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 ) {
|
if( writeExecutor!=null ) {
|
||||||
writeExecutor.shutdown
|
writeExecutor.shutdown
|
||||||
writeExecutor.awaitTermination(60, TimeUnit.SECONDS)
|
writeExecutor.awaitTermination(60, TimeUnit.SECONDS)
|
||||||
|
|
|
@ -243,6 +243,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
|
||||||
master_stopped.set(true)
|
master_stopped.set(true)
|
||||||
position = master.wal_append_position
|
position = master.wal_append_position
|
||||||
stopped_latch.countDown()
|
stopped_latch.countDown()
|
||||||
|
master = null
|
||||||
func
|
func
|
||||||
})
|
})
|
||||||
master.blocking_executor.execute(^{
|
master.blocking_executor.execute(^{
|
||||||
|
|
Loading…
Reference in New Issue