mirror of https://github.com/apache/lucene.git
SOLR-6950: Ensure TransactionLogs are closed with test ObjectReleaseTracker.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1650781 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5e8eb5cd46
commit
d97b1cef28
|
@ -33,6 +33,7 @@ import org.apache.solr.common.util.DataInputInputStream;
|
|||
import org.apache.solr.common.util.FastInputStream;
|
||||
import org.apache.solr.common.util.FastOutputStream;
|
||||
import org.apache.solr.common.util.JavaBinCodec;
|
||||
import org.apache.solr.common.util.ObjectReleaseTracker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -114,6 +115,8 @@ public class HdfsTransactionLog extends TransactionLog {
|
|||
|
||||
success = true;
|
||||
|
||||
assert ObjectReleaseTracker.track(this);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
|
||||
} finally {
|
||||
|
@ -305,6 +308,7 @@ public class HdfsTransactionLog extends TransactionLog {
|
|||
log.error("Exception closing tlog.", e);
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
|
||||
} finally {
|
||||
assert ObjectReleaseTracker.release(this);
|
||||
if (deleteOnClose) {
|
||||
try {
|
||||
fs.delete(tlogFile, true);
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.apache.solr.common.util.DataInputInputStream;
|
|||
import org.apache.solr.common.util.FastInputStream;
|
||||
import org.apache.solr.common.util.FastOutputStream;
|
||||
import org.apache.solr.common.util.JavaBinCodec;
|
||||
import org.apache.solr.common.util.ObjectReleaseTracker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -177,6 +178,8 @@ public class TransactionLog {
|
|||
}
|
||||
|
||||
success = true;
|
||||
|
||||
assert ObjectReleaseTracker.track(this);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
|
||||
|
@ -553,6 +556,8 @@ public class TransactionLog {
|
|||
}
|
||||
} catch (IOException e) {
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
|
||||
} finally {
|
||||
assert ObjectReleaseTracker.release(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue