[ 
https://issues.apache.org/jira/browse/SOLR-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519695#comment-14519695
 ] 

Tomás Fernández Löbbe edited comment on SOLR-7486 at 4/29/15 4:43 PM:
----------------------------------------------------------------------

In general, I think the way it is now is better for back compatibility when 
deprecating. If you have extended HttpSolrClient (before the addition of 
"close()") and overrode "shutdown()", then your code could stop working with 
your change. That said, in this specific case, you are probably also calling 
"super.shutdown()", because otherwise the httpClients are not closed, but we 
can only be sure about that in this case because those are private fields.
bq. If anyone extends HttpSolrClient, he needs to override both methods to make 
sure things are closed properly.
If you are extending now, you should extend close(), and make sure you call 
super.close() at some point. That will work with 5 and trunk.


was (Author: tomasflobbe):
In general, I think the way it is now is better for back compatibility when 
deprecating. If you have extended HttpSolrClient (before the addition of 
"close()") and overrode "shutdown()", then your code may stop working. That 
said, in this specific case, you are probably also calling "super.shutdown()", 
because otherwise the httpClients are not closed, but we can only be sure about 
that in this case because those are private fields.
bq. If anyone extends HttpSolrClient, he needs to override both methods to make 
sure things are closed properly.
If you are extending now, you should extend close(), and make sure you call 
super.close() at some point. That will work with 5 and trunk.

> HttpSolrClient.shutdown() should call close() and not vice versa
> ----------------------------------------------------------------
>
>                 Key: SOLR-7486
>                 URL: https://issues.apache.org/jira/browse/SOLR-7486
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>             Fix For: 5.2
>
>         Attachments: SOLR-7486.patch
>
>
> HttpSolrClient.shutdown() is deprecated, however close() calls it instead of 
> the other way around. If anyone extends HttpSolrClient, he needs to override 
> both methods to make sure things are closed properly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to