From 9de3fff1f5c7741e8b22d821aadc4225cd3500a4 Mon Sep 17 00:00:00 2001 From: Hiram Chirino Date: Mon, 21 Dec 2015 11:18:08 -0500 Subject: [PATCH] Fixes AMQ-5404: LevelDB files not being released after deletion --- .../main/scala/org/apache/activemq/leveldb/RecordLog.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala index 1ab66cee1f..c9b7916a93 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala @@ -155,6 +155,12 @@ case class RecordLog(directory: File, logSuffix:String) { onDelete(info.file) onDelete(id) log_infos.remove(id) + reader_cache.synchronized { + val reader = reader_cache.remove(info.file); + if( reader!=null ) { + reader.release(); + } + } } } }