Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5629

SolrIndexSearcher.name should include core name

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7, 6.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
        shalinmangar 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
        shalinmangar 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
        jira-bot 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
        jira-bot 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
        jira-bot 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
        jira-bot 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 Shikhar Bhushan added a comment -

        Thanks Erick! Yup, in SolrIndexSearcher constructor

        Show
        shikhar Shikhar Bhushan added a comment - Thanks Erick! Yup, in SolrIndexSearcher constructor
        Hide
        erickerickson 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
        erickerickson 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:
            erickerickson Erick Erickson
            Reporter:
            shikhar Shikhar Bhushan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development