Solr
  1. Solr
  2. SOLR-3774

/admin/mbean returning duplicate search handlers with names that map to their classes?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Offshoot of SOLR-3232...

      Along with some valid entries with names equal to the request handler names (/get search /browse) it also turned up one with the name "org.apache.solr.handler.RealTimeGetHandler" and another with the name "org.apache.solr.handler.component.SearchHandler"

      ...seems that we may have a bug with request handlers getting registered multiple times, once under their "real" name and once using their class?

      1. SOLR-3774.patch
        0.8 kB
        Mark Miller
      2. SOLR-3774.patch
        5 kB
        Tomás Fernández Löbbe

        Issue Links

          Activity

          Hide
          Tomás Fernández Löbbe added a comment -

          I think there are two problems here. One is that we are registering the request handlers twice, once on RequestHandlers.initHandlersFromConfig(...) and once in SolrResourceLoader.inform(...). The other problem is that we are using the RH classname as the name of the MBean. This will cause problems when you have multiple request handlers of the same class. I think the correct way would be to use the name defined for the request handler in the solrconfig.xml file (as we currently do with SearchComponents). I'll upload a patch for this.

          Show
          Tomás Fernández Löbbe added a comment - I think there are two problems here. One is that we are registering the request handlers twice, once on RequestHandlers.initHandlersFromConfig(...) and once in SolrResourceLoader.inform(...). The other problem is that we are using the RH classname as the name of the MBean. This will cause problems when you have multiple request handlers of the same class. I think the correct way would be to use the name defined for the request handler in the solrconfig.xml file (as we currently do with SearchComponents). I'll upload a patch for this.
          Hide
          Tomás Fernández Löbbe added a comment -

          This fixes the issue. I chose not to modify the RequestHandler interface to add a "setName" method because I think it may be too much impact for this issue, Instead of it I edited the RequestHandlerBase class, but because of that I had to do some instanceofs to set the name. I'm open to other opinions on that.
          The RH are still being registered twice now, but now with the same name, not sure if we should change that because there is no real impact.

          Show
          Tomás Fernández Löbbe added a comment - This fixes the issue. I chose not to modify the RequestHandler interface to add a "setName" method because I think it may be too much impact for this issue, Instead of it I edited the RequestHandlerBase class, but because of that I had to do some instanceofs to set the name. I'm open to other opinions on that. The RH are still being registered twice now, but now with the same name, not sure if we should change that because there is no real impact.
          Hide
          Mark Miller added a comment -

          I duplicated this issue with SOLR-6750.

          The way I solved is to not let SolrResourceLoader.inform add any of the same objects that already exist with a simple check of !infoRegistry.containsValue(bean). I think it might be a better check than relying on names because we don't really ever want to add the same object twice - especially considering SOLR-6586.

              for (SolrInfoMBean bean : arr) {
                if (!infoRegistry.containsValue(bean)) {
                  try {
                    infoRegistry.put(bean.getName(), bean);
                  } catch (Exception e) {
                    log.warn("could not register MBean '" + bean.getName() + "'.", e);
                  }
                }
              }
          
          Show
          Mark Miller added a comment - I duplicated this issue with SOLR-6750 . The way I solved is to not let SolrResourceLoader.inform add any of the same objects that already exist with a simple check of !infoRegistry.containsValue(bean). I think it might be a better check than relying on names because we don't really ever want to add the same object twice - especially considering SOLR-6586 . for (SolrInfoMBean bean : arr) { if (!infoRegistry.containsValue(bean)) { try { infoRegistry.put(bean.getName(), bean); } catch (Exception e) { log.warn( "could not register MBean '" + bean.getName() + "'." , e); } } }
          Hide
          Tomás Fernández Löbbe added a comment -

          I think that makes sense

          Show
          Tomás Fernández Löbbe added a comment - I think that makes sense
          Hide
          Gregory Chanan added a comment -

          +1

          Show
          Gregory Chanan added a comment - +1
          Hide
          Shalin Shekhar Mangar added a comment -

          +1

          Show
          Shalin Shekhar Mangar added a comment - +1
          Hide
          ASF subversion and git services added a comment -

          Commit 1640623 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1640623 ]

          SOLR-3774: Solr adds RequestHandler SolrInfoMBeans twice to the JMX server.

          Show
          ASF subversion and git services added a comment - Commit 1640623 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1640623 ] SOLR-3774 : Solr adds RequestHandler SolrInfoMBeans twice to the JMX server.
          Hide
          ASF subversion and git services added a comment -

          Commit 1640625 from Mark Miller in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1640625 ]

          SOLR-3774: Solr adds RequestHandler SolrInfoMBeans twice to the JMX server.

          Show
          ASF subversion and git services added a comment - Commit 1640625 from Mark Miller in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1640625 ] SOLR-3774 : Solr adds RequestHandler SolrInfoMBeans twice to the JMX server.
          Hide
          ASF subversion and git services added a comment -

          Commit 1640756 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1640756 ]

          SOLR-3774: Fix test.

          Show
          ASF subversion and git services added a comment - Commit 1640756 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1640756 ] SOLR-3774 : Fix test.
          Hide
          ASF subversion and git services added a comment -

          Commit 1640757 from Mark Miller in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1640757 ]

          SOLR-3774: Fix test.

          Show
          ASF subversion and git services added a comment - Commit 1640757 from Mark Miller in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1640757 ] SOLR-3774 : Fix test.
          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:
              Mark Miller
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development