You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/05/22 19:59:02 UTC
[25/50] [abbrv] lucene-solr:jira/solr-11779: SOLR-11277: Synchronize
UpdateLog.getCurrentLogSizeFromStream and return size of tlog as 0 to avoid
NPE
SOLR-11277: Synchronize UpdateLog.getCurrentLogSizeFromStream and return size of tlog as 0 to avoid NPE
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/27c6275c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/27c6275c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/27c6275c
Branch: refs/heads/jira/solr-11779
Commit: 27c6275c484f2dcb73cc64a06fb42ba2c4eefcbf
Parents: b1ee23c
Author: Anshum Gupta <an...@apache.org>
Authored: Fri May 18 09:56:52 2018 -0700
Committer: Anshum Gupta <an...@apache.org>
Committed: Fri May 18 09:56:52 2018 -0700
----------------------------------------------------------------------
solr/core/src/java/org/apache/solr/update/UpdateLog.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/27c6275c/solr/core/src/java/org/apache/solr/update/UpdateLog.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/UpdateLog.java b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
index 09ff146..ef0e73e 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateLog.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
@@ -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() {