Solr
  1. Solr
  2. SOLR-6918

No need to log exceptions (as warn) generated when creating MBean stats if the core is shutting down

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: JMX
    • Labels:
      None

      Description

      I'm seeing tons of this warning when distributed SolrCloud tests are shutting down ...

      I don't think we should log a WARN message if the exception is AlreadyClosedException since the core is closing

      [junit4] 2> 31971 T37 oasc.JmxMonitoredMap$SolrDynamicMBean.getMBeanInfo WARN Could not getStatistics on info bean org.apache.solr.handler.ReplicationHandler org.apache.solr.common.SolrException: openNewSearcher called on closed core
      [junit4] 2> at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1498)
      [junit4] 2> at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1736)
      [junit4] 2> at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1481)
      [junit4] 2> at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1416)
      [junit4] 2> at org.apache.solr.handler.ReplicationHandler.getIndexVersion(ReplicationHandler.java:558)
      [junit4] 2> at org.apache.solr.handler.ReplicationHandler.getStatistics(ReplicationHandler.java:575)
      [junit4] 2> at org.apache.solr.core.JmxMonitoredMap$SolrDynamicMBean.getMBeanInfo(JmxMonitoredMap.java:257)
      [junit4] 2> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getClassName(DefaultMBeanServerInterceptor.java:1804)
      [junit4] 2> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.safeGetClassName(DefaultMBeanServerInterceptor.java:1595)
      [junit4] 2> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.objectInstancesFromFilteredNamedObjects(DefaultMBeanServerInterceptor.java:1556)
      [junit4] 2> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryMBeansImpl(DefaultMBeanServerInterceptor.java:513)
      [junit4] 2> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNames(DefaultMBeanServerInterceptor.java:526)
      [junit4] 2> at com.sun.jmx.mbeanserver.JmxMBeanServer.queryNames(JmxMBeanServer.java:619)
      [junit4] 2> at org.apache.solr.core.JmxMonitoredMap.clear(JmxMonitoredMap.java:120)
      [junit4] 2> at org.apache.solr.core.SolrCore.close(SolrCore.java:1161)
      [junit4] 2> at org.apache.solr.core.CoreContainer.unload(CoreContainer.java:691)
      [junit4] 2> at org.apache.solr.handler.admin.CoreAdminHandler.handleUnloadAction(CoreAdminHandler.java:676)
      [junit4] 2> at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:209)
      [junit4] 2> at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:188)
      [junit4] 2> at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:144)
      [junit4] 2> at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:738)
      [junit4] 2> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:254)
      [junit4] 2> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:201)

      1. SOLR-6918.patch
        2 kB
        Timothy Potter
      2. SOLR-6918.patch
        1.0 kB
        Timothy Potter

        Activity

        Hide
        Timothy Potter added a comment -

        Simple patch to avoid logging a WARN if the cause of the exception is that the Lucene index is already closed (core is shutting down). I opted for this approach instead of logging the WARN without the stacktrace since you still get a flood of these when cores are going down (and might cause people concern).

        Show
        Timothy Potter added a comment - Simple patch to avoid logging a WARN if the cause of the exception is that the Lucene index is already closed (core is shutting down). I opted for this approach instead of logging the WARN without the stacktrace since you still get a flood of these when cores are going down (and might cause people concern).
        Hide
        Shalin Shekhar Mangar added a comment -

        Yeah, that's my fault. This started with SOLR-2927 where we close the searcher before JMX is closed. For some strange reason, closing the jmx registry needs to access the value and hence this error.

        Show
        Shalin Shekhar Mangar added a comment - Yeah, that's my fault. This started with SOLR-2927 where we close the searcher before JMX is closed. For some strange reason, closing the jmx registry needs to access the value and hence this error.
        Hide
        Timothy Potter added a comment -

        Oops! previous patch missed a case where a SolrException is generated by the ReplicationHandler instead of an AlreadyClosedException ... updated patch fixes that too

        Show
        Timothy Potter added a comment - Oops! previous patch missed a case where a SolrException is generated by the ReplicationHandler instead of an AlreadyClosedException ... updated patch fixes that too
        Hide
        Timothy Potter added a comment -

        yeah, the JMX MBeanServer has to call getMBeanInfo to satisfy the query for coreHashCode (for queryNames) ...

        Show
        Timothy Potter added a comment - yeah, the JMX MBeanServer has to call getMBeanInfo to satisfy the query for coreHashCode (for queryNames) ...
        Hide
        ASF subversion and git services added a comment -

        Commit 1650123 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1650123 ]

        SOLR-6918: No need to log exceptions (as warn) generated when creating MBean stats if core is shutting down

        Show
        ASF subversion and git services added a comment - Commit 1650123 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1650123 ] SOLR-6918 : No need to log exceptions (as warn) generated when creating MBean stats if core is shutting down
        Hide
        ASF subversion and git services added a comment -

        Commit 1650124 from Timothy Potter in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1650124 ]

        SOLR-6918: No need to log exceptions (as warn) generated when creating MBean stats if core is shutting down

        Show
        ASF subversion and git services added a comment - Commit 1650124 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1650124 ] SOLR-6918 : No need to log exceptions (as warn) generated when creating MBean stats if core is shutting down
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Timothy Potter
            Reporter:
            Timothy Potter
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development