Solr
  1. Solr
  2. SOLR-7984

totally bogus and missleading "no default request handler is registered" logged by RequestHandlers

    Details

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

      Description

      As noted on the user list by Scott Hollenbeck the following warning can be logged by solr...

      no default request handler is registered (either '/select' or 'standard')

      ...even if there is both a handler named "standard" and a handler (in his case named "pinkPony") defined as default="true".

      The code in question appears to be total nonsense...

          if(!handlers.alias( "/select","")){
            if(!handlers.alias( "standard","")){
              log.warn("no default request handler is registered (either '/select' or 'standard')");
            }
          }
      
      • PluginBag.alias is not documented, but appears to be a mutating operation that adds an alias if and only if the first arg is aname of something that exists, and the second arg is a name that does not already exist – returning true if the alias is added
      • if an alias already exists with the (default) name "" (which initHandlersFromConfig takes care of registring before this code) then neither of these can be made the new default.
      • just because neither of these aren't made the default here, doesn't mean there isn't already a default handler – it actually means the exact oposite
      • if the goal was to log an error when there is no default, then that should have just been checked directly

        Activity

        Hide
        Hoss Man added a comment -

        this was the change made by Noble Paul in r1665295 for SOLR-7073 - I see no rationale for the restructing of the code so that the warning is conditionally nested like this, but assigning to noble to sanity check and clarify what his goal was here...

        +    if(!handlers.alias( "/select","")){
        +      if(!handlers.alias( "standard","")){
        +        log.warn("no default request handler is registered (either '/select' or 'standard')");
               }
             }
         
        -    if(get("") == null) register("", get("/select"));//defacto default handler
        -    if(get("") == null) register("", get("standard"));//old default handler name; TODO remove?
        -    if(get("") == null)
        -      log.warn("no default request handler is registered (either '/select' or 'standard')");
        
        Show
        Hoss Man added a comment - this was the change made by Noble Paul in r1665295 for SOLR-7073 - I see no rationale for the restructing of the code so that the warning is conditionally nested like this, but assigning to noble to sanity check and clarify what his goal was here... + if(!handlers.alias( "/select","")){ + if(!handlers.alias( "standard","")){ + log.warn("no default request handler is registered (either '/select' or 'standard')"); } } - if(get("") == null) register("", get("/select"));//defacto default handler - if(get("") == null) register("", get("standard"));//old default handler name; TODO remove? - if(get("") == null) - log.warn("no default request handler is registered (either '/select' or 'standard')");
        Hide
        Noble Paul added a comment -

        The objective was to have the exact same behavior. But turns out that it doesn't

        Show
        Noble Paul added a comment - The objective was to have the exact same behavior. But turns out that it doesn't
        Hide
        ASF subversion and git services added a comment -

        Commit 1700840 from Noble Paul in branch 'dev/trunk'
        [ https://svn.apache.org/r1700840 ]

        SOLR-7984: wrong and misleading error message 'no default request handler is registered'

        Show
        ASF subversion and git services added a comment - Commit 1700840 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1700840 ] SOLR-7984 : wrong and misleading error message 'no default request handler is registered'
        Hide
        ASF subversion and git services added a comment -

        Commit 1700841 from Noble Paul in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1700841 ]

        SOLR-7984: wrong and misleading error message 'no default request handler is registered'

        Show
        ASF subversion and git services added a comment - Commit 1700841 from Noble Paul in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1700841 ] SOLR-7984 : wrong and misleading error message 'no default request handler is registered'
        Hide
        ASF subversion and git services added a comment -

        Commit 2977efa922b92500cef424139306fc04e08b65a7 in lucene-solr's branch refs/heads/master from Noble Paul
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2977efa ]

        updatd the test in according with SOLR-7984

        Show
        ASF subversion and git services added a comment - Commit 2977efa922b92500cef424139306fc04e08b65a7 in lucene-solr's branch refs/heads/master from Noble Paul [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2977efa ] updatd the test in according with SOLR-7984

          People

          • Assignee:
            Noble Paul
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development