SOLR-11277: Synchronize UpdateLog.getCurrentLogSizeFromStream and return size of tlog as 0 to avoid NPE

This commit is contained in:
Anshum Gupta 2018-05-18 09:56:52 -07:00
parent b1ee23c525
commit 27c6275c48
1 changed files with 2 additions and 2 deletions

View File

@ -295,8 +295,8 @@ public class UpdateLog implements PluginInfoInitialized, SolrMetricProducer {
/**
* @return the current transaction log's size (based on its output stream)
*/
public long getCurrentLogSizeFromStream() {
return tlog.getLogSizeFromStream();
public synchronized long getCurrentLogSizeFromStream() {
return tlog == null ? 0 : tlog.getLogSizeFromStream();
}
public long getTotalLogsNumber() {