lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trym Møller (JIRA) <j...@apache.org>
Subject [jira] [Updated] (SOLR-4066) SolrZKClient changed interface
Date Mon, 12 Nov 2012 08:48:12 GMT

     [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Trym Møller updated SOLR-4066:
------------------------------

    Description: 
The constructor of SolrZKClient has changed, I expect to ensure clean up of resources. The
strategy is as follows:
{code}
 connManager = new ConnectionManager(...)
 try {
    ...
 } catch (Throwable e) {
       connManager.close();
       throw new RuntimeException();
 }
 try {
   connManager.waitForConnected(clientConnectTimeout);
 } catch (Throwable e) {
   connManager.close();
   throw new RuntimeException();
 }
{code}

This results in a different exception (RuntimeException) returned from the constructor as
earlier (nice exceptions as UnknownHostException, TimeoutException).

Can this be changed so we keep the old nice exceptions e.g. as follows (requiring the constructor
to declare these) or at least include them as cause in the RuntimeException?

{code}
 boolean closeBecauseOfException = true;
 try {
     ...
    connManager.waitForConnected(clientConnectTimeout);
    closeBecauseOfException = false
 } finally {
     if (closeBecauseOfException) {
         connManager.close();
     }
 } 
{code}

  was:
The constructor of SolrZKClient has changed, I expect to ensure clean up of resources. The
strategy is as follows:
 connManager = new ConnectionManager(...)
 try {
    ...
 } catch (Throwable e) {
       connManager.close();
       throw new RuntimeException();
 }
 try {
   connManager.waitForConnected(clientConnectTimeout);
 } catch (Throwable e) {
   connManager.close();
   throw new RuntimeException();
 }

This results in a different exception (RuntimeException) returned from the constructor as
earlier (nice exceptions as UnknownHostException, TimeoutException).

Can this be changed so we keep the old nice exceptions e.g. as follows (requiring the constructor
to declare these) or at least include them as cause in the RuntimeException?

 boolean closeBecauseOfException = true;
 try {
     ...
    connManager.waitForConnected(clientConnectTimeout);
    closeBecauseOfException = false
 } finally {
     if (closeBecauseOfException) {
         connManager.close();
     }
 } 


    
> SolrZKClient changed interface
> ------------------------------
>
>                 Key: SOLR-4066
>                 URL: https://issues.apache.org/jira/browse/SOLR-4066
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 4.0, 4.0.1, 4.1
>         Environment: Any
>            Reporter: Trym Møller
>            Priority: Minor
>
> The constructor of SolrZKClient has changed, I expect to ensure clean up of resources.
The strategy is as follows:
> {code}
>  connManager = new ConnectionManager(...)
>  try {
>     ...
>  } catch (Throwable e) {
>        connManager.close();
>        throw new RuntimeException();
>  }
>  try {
>    connManager.waitForConnected(clientConnectTimeout);
>  } catch (Throwable e) {
>    connManager.close();
>    throw new RuntimeException();
>  }
> {code}
> This results in a different exception (RuntimeException) returned from the constructor
as earlier (nice exceptions as UnknownHostException, TimeoutException).
> Can this be changed so we keep the old nice exceptions e.g. as follows (requiring the
constructor to declare these) or at least include them as cause in the RuntimeException?
> {code}
>  boolean closeBecauseOfException = true;
>  try {
>      ...
>     connManager.waitForConnected(clientConnectTimeout);
>     closeBecauseOfException = false
>  } finally {
>      if (closeBecauseOfException) {
>          connManager.close();
>      }
>  } 
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message