Solr
  1. Solr
  2. SOLR-5108

plugin loading should fail if mor then one instance of a singleton plugin is found

    Details

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

      Description

      Continuing from the config parsing/validation work done in SOLR-4953, we should improve SolrConfig so that parsing fails if multiple instances of a "plugin" are found for types of plugins where only one is allowed to be used at a time.

      at the moment, SolrConfig.loadPluginInfo happily initializes a List<PluginInfo> for whatever xpath it's given, and then later code can either call List<PluginInfo> getPluginInfos(String) or PluginInfo getPluginInfo(String) (the later just being shorthand for getting the first item in the list.

      we could make getPluginInfo(String) throw an error if the list has multiple items, but i think we should also change the signature of loadPluginInfo to be explicit about how many instances we expect to find, so we can error earlier, and have a redundant check.

        Issue Links

          Activity

          Hide
          Jack Krupansky added a comment -

          Sounds like this might resolve SOLR-4304 - "NPE in Solr SpellCheckComponent if more than one QueryConverter".

          Show
          Jack Krupansky added a comment - Sounds like this might resolve SOLR-4304 - "NPE in Solr SpellCheckComponent if more than one QueryConverter".
          Hide
          Hoss Man added a comment -

          Jack: I think it will sort of "fix" SOLR-4304 in that i think I can make it so that instead of getting an NPE at request time, you'll get an error on startup that you can't have multiple queryConvertors.

          but in general the way queryConvertors are configured/initialized seems to be a giant pile of crap – i'll post more details in SOLR-4304

          Show
          Hoss Man added a comment - Jack: I think it will sort of "fix" SOLR-4304 in that i think I can make it so that instead of getting an NPE at request time, you'll get an error on startup that you can't have multiple queryConvertors. but in general the way queryConvertors are configured/initialized seems to be a giant pile of crap – i'll post more details in SOLR-4304
          Hide
          Hoss Man added a comment -

          patch...

          • requires usage of loadPluginInfo to specify if multiple PluginInfo instances are expected else error
          • makes getPluginInfo fail if multiple PluginInfo instances exist
          • adds a test for a good error if multiple instances of directoryFactory are found (as an example)
          • fixes a bug in solrconfig-test-misc.xml that actually did have redundent directoryFactories configured.
          Show
          Hoss Man added a comment - patch... requires usage of loadPluginInfo to specify if multiple PluginInfo instances are expected else error makes getPluginInfo fail if multiple PluginInfo instances exist adds a test for a good error if multiple instances of directoryFactory are found (as an example) fixes a bug in solrconfig-test-misc.xml that actually did have redundent directoryFactories configured.
          Hide
          ASF subversion and git services added a comment -

          Commit 1515852 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1515852 ]

          SOLR-5108: fail plugin info loading if multiple instances exist but only one is expected

          Show
          ASF subversion and git services added a comment - Commit 1515852 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1515852 ] SOLR-5108 : fail plugin info loading if multiple instances exist but only one is expected
          Hide
          ASF subversion and git services added a comment -

          Commit 1515859 from hossman@apache.org in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1515859 ]

          SOLR-5108: fail plugin info loading if multiple instances exist but only one is expected (merge r1515852)

          Show
          ASF subversion and git services added a comment - Commit 1515859 from hossman@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1515859 ] SOLR-5108 : fail plugin info loading if multiple instances exist but only one is expected (merge r1515852)
          Hide
          Adrien Grand added a comment -

          4.5 release -> bulk close

          Show
          Adrien Grand added a comment - 4.5 release -> bulk close

            People

            • Assignee:
              Hoss Man
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development