Solr
  1. Solr
  2. SOLR-5629

SolrIndexSearcher.name should include core name

    Details

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

      Description

      The name attribute on SolrIndexSearcher is used in log lines, but does not include the core name.

      So in a multi-core setup it is unnecessarily difficult to trace what core's searcher is being referred to, e.g. in log lines that provide info on searcher opens & closes.

      One-line patch that helps:

      Replace

      this.name = "Searcher@" + Integer.toHexString(hashCode()) + (name!=null ? " "+name : "");
      

      with

      this.name = "Searcher@" + Integer.toHexString(hashCode()) + "[" + core.getName() + "]" + (name!=null ? " "+name : "");
      

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        This was a trivial fix so I went ahead and committed it. I hope you don't mind Erick.

        Thanks Shikhar!

        Show
        Shalin Shekhar Mangar added a comment - This was a trivial fix so I went ahead and committed it. I hope you don't mind Erick. Thanks Shikhar!
        Hide
        ASF subversion and git services added a comment -

        Commit 1565140 from shalin@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1565140 ]

        SOLR-5629: SolrIndexSearcher.name should include core name

        Show
        ASF subversion and git services added a comment - Commit 1565140 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1565140 ] SOLR-5629 : SolrIndexSearcher.name should include core name
        Hide
        ASF subversion and git services added a comment -

        Commit 1565138 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1565138 ]

        SOLR-5629: SolrIndexSearcher.name should include core name

        Show
        ASF subversion and git services added a comment - Commit 1565138 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1565138 ] SOLR-5629 : SolrIndexSearcher.name should include core name
        Hide
        Shikhar Bhushan added a comment -

        Thanks Erick! Yup, in SolrIndexSearcher constructor

        Show
        Shikhar Bhushan added a comment - Thanks Erick! Yup, in SolrIndexSearcher constructor
        Hide
        Erick Erickson added a comment -

        Assigned to myself just so it doesn't get lost, this seems uncontroversial.

        But where is this supposed to go? It looks like SolrIndexSearcher, about line 196 in 4x...

        Show
        Erick Erickson added a comment - Assigned to myself just so it doesn't get lost, this seems uncontroversial. But where is this supposed to go? It looks like SolrIndexSearcher, about line 196 in 4x...

          People

          • Assignee:
            Erick Erickson
            Reporter:
            Shikhar Bhushan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development