You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2015/01/07 18:39:38 UTC

svn commit: r1650124 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java

Author: thelabdude
Date: Wed Jan  7 17:39:38 2015
New Revision: 1650124

URL: http://svn.apache.org/r1650124
Log:
SOLR-6918: No need to log exceptions (as warn) generated when creating MBean stats if core is shutting down

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1650124&r1=1650123&r2=1650124&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Wed Jan  7 17:39:38 2015
@@ -600,6 +600,9 @@ Other Changes
 
 * SOLR-6830: Update Woodstox to 4.4.1 and StAX to 3.1.4. (ab)
 
+* SOLR-6918: No need to log exceptions (as warn) generated when creating MBean stats if
+  the core is shutting down (Timothy Potter)
+
 ==================  4.10.3 ==================
 
 Bug Fixes

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java?rev=1650124&r1=1650123&r2=1650124&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java Wed Jan  7 17:39:38 2015
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.core;
 
+import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrConfig.JmxConfiguration;
@@ -279,7 +280,9 @@ public class JmxMonitoredMap<K, V> exten
           }
         }
       } catch (Exception e) {
-        LOG.warn("Could not getStatistics on info bean {}", infoBean.getName(), e);
+        // don't log issue if the core is closing
+        if (!(SolrException.getRootCause(e) instanceof AlreadyClosedException))
+          LOG.warn("Could not getStatistics on info bean {}", infoBean.getName(), e);
       }
 
       MBeanAttributeInfo[] attrInfoArr = attrInfoList

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java?rev=1650124&r1=1650123&r2=1650124&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java Wed Jan  7 17:39:38 2015
@@ -572,7 +572,7 @@ public class ReplicationHandler extends
     NamedList list = super.getStatistics();
     if (core != null) {
       list.add("indexSize", NumberUtils.readableSize(getIndexSize()));
-      CommitVersionInfo vInfo = getIndexVersion();
+      CommitVersionInfo vInfo = (core != null && !core.isClosed()) ? getIndexVersion(): null;
       list.add("indexVersion", null == vInfo ? 0 : vInfo.version);
       list.add(GENERATION, null == vInfo ? 0 : vInfo.generation);