Solr
  1. Solr
  2. SOLR-6954

Considering changing SolrClient#shutdown to SolrClient#close.

    Details

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

      Description

      SolrClient#shutdown is not as odd as SolrServer#shutdown, but as we want users to release these objects, close is more standard and if we implement Closeable, tools help point out leaks.

      1. SOLR-6954.patch
        311 kB
        Alan Woodward
      2. SOLR-6954.patch
        315 kB
        Alan Woodward
      3. SOLR-6954.patch
        312 kB
        Alan Woodward
      4. SOLR-6954-deprecations.patch
        5 kB
        Alan Woodward

        Activity

        Hide
        Mark Miller added a comment -

        Of course we can leave shutdown for now and deprecate if we want to allow a slow path.

        Show
        Mark Miller added a comment - Of course we can leave shutdown for now and deprecate if we want to allow a slow path.
        Hide
        Alan Woodward added a comment -

        +1.

        I'd suggest we just make shutdown() delegate to close() and deprecate it.

        Might be worth doing the same thing for CoreContainer?

        Show
        Alan Woodward added a comment - +1. I'd suggest we just make shutdown() delegate to close() and deprecate it. Might be worth doing the same thing for CoreContainer?
        Hide
        Uwe Schindler added a comment -

        +1, especially because of warnings in IDEs!

        Show
        Uwe Schindler added a comment - +1, especially because of warnings in IDEs!
        Hide
        Alan Woodward added a comment -

        Patch making SolrClient implement Closeable, and making shutdown() a deprecated concrete method that delegates to close(). Also cuts over all tests to use close() (and try-with-resources where possible).

        Show
        Alan Woodward added a comment - Patch making SolrClient implement Closeable, and making shutdown() a deprecated concrete method that delegates to close(). Also cuts over all tests to use close() (and try-with-resources where possible).
        Hide
        Tomás Fernández Löbbe added a comment -

        I think it's better if close delegates in shutdown for now, that way if someone has extended shutdown their code would still work.

        Show
        Tomás Fernández Löbbe added a comment - I think it's better if close delegates in shutdown for now, that way if someone has extended shutdown their code would still work.
        Hide
        Alan Woodward added a comment -

        Good point, Tomas. Here's an updated patch.

        Show
        Alan Woodward added a comment - Good point, Tomas. Here's an updated patch.
        Hide
        Alan Woodward added a comment -

        I plan on committing this tomorrow.

        Show
        Alan Woodward added a comment - I plan on committing this tomorrow.
        Hide
        Alan Woodward added a comment -

        Final patch.

        Show
        Alan Woodward added a comment - Final patch.
        Hide
        ASF subversion and git services added a comment -

        Commit 1655263 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1655263 ]

        SOLR-6954: SolrClient implements Closeable

        Show
        ASF subversion and git services added a comment - Commit 1655263 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1655263 ] SOLR-6954 : SolrClient implements Closeable
        Hide
        ASF subversion and git services added a comment -

        Commit 1655273 from Alan Woodward in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1655273 ]

        SOLR-6954: SolrClient implements Closeable

        Show
        ASF subversion and git services added a comment - Commit 1655273 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1655273 ] SOLR-6954 : SolrClient implements Closeable
        Hide
        ASF subversion and git services added a comment -

        Commit 1655277 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1655277 ]

        SOLR-6954: Remove deprecated SolrClient.shutdown() method from trunk

        Show
        ASF subversion and git services added a comment - Commit 1655277 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1655277 ] SOLR-6954 : Remove deprecated SolrClient.shutdown() method from trunk
        Hide
        Alan Woodward added a comment -

        Patch for trunk - removes shutdown() method entirely.

        Show
        Alan Woodward added a comment - Patch for trunk - removes shutdown() method entirely.
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

          • Assignee:
            Alan Woodward
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development