You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Trym Møller (JIRA)" <ji...@apache.org> on 2012/11/12 09:40:12 UTC

[jira] [Created] (SOLR-4066) SolrZKClient changed interface

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

             Summary: 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:
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();
    }
} 

--
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


[jira] [Assigned] (SOLR-4066) SolrZKClient changed interface

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller reassigned SOLR-4066:
---------------------------------

    Assignee: Mark Miller
    
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Updated] (SOLR-4066) SolrZKClient changed interface

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated SOLR-4066:
------------------------------

    Fix Version/s: 5.0
                   4.1
    
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Updated] (SOLR-4066) SolrZKClient changed interface

Posted by "Trym Møller (JIRA)" <ji...@apache.org>.
     [ 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


[jira] [Comment Edited] (SOLR-4066) SolrZKClient changed interface

Posted by "Trym Møller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496912#comment-13496912 ] 

Trym Møller edited comment on SOLR-4066 at 11/14/12 7:10 AM:
-------------------------------------------------------------

The provided solution of 3989 is fine with me, my proposal was just to keep the "orginal" behaviour.
So it can be closed for my sake.

Best regards Trym
                
      was (Author: trym):
    The provided solution of 3989 is fine with me, my proposal was just to keep the "orginal" behaviour.

Best regards Trym
                  
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Commented] (SOLR-4066) SolrZKClient changed interface

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495183#comment-13495183 ] 

Uwe Schindler commented on SOLR-4066:
-------------------------------------

In general it should not throw a plain message-less RuntimException, at least a message should be attached, too.
                
> 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
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Commented] (SOLR-4066) SolrZKClient changed interface

Posted by "Trym Møller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496912#comment-13496912 ] 

Trym Møller commented on SOLR-4066:
-----------------------------------

The provided solution of 3989 is fine with me, my proposal was just to keep the "orginal" behaviour.

Best regards Trym
                
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Resolved] (SOLR-4066) SolrZKClient changed interface

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller resolved SOLR-4066.
-------------------------------

    Resolution: Duplicate
    
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Updated] (SOLR-4066) SolrZKClient changed interface

Posted by "Trym Møller (JIRA)" <ji...@apache.org>.
     [ 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:
 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();
     }
 } 


  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:
>  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();
>      }
>  } 

--
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


[jira] [Updated] (SOLR-4066) SolrZKClient changed interface

Posted by "Per Steffensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Per Steffensen updated SOLR-4066:
---------------------------------

    Attachment: SOLR-4066.patch

Hi Trym

I believe one of the reasons that they started throwing RuntimeExceptions insted of UnknownHostException, TimeoutException etc is that the method signature has changed to not have a "throws"-part. They probably do not want do deal with those checked exceptions. If they want to keep the method signature this way, there is no way to get checked excpetions (like UnknownHostException and TimeoutException) out of this method - therefore the simplest solution is at least to include the actual exceptions as cause on the RuntimeExceptions - see patch SOLR-4066.patch. You could tak this patch in as a first solution, and if it just is an accident that the checked excpetions was removed from the method signature, then of course you can add them again and make sure the actual exceptions are thrown correctly.
                
> 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
>         Attachments: SOLR-4066.patch
>
>
> 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


[jira] [Updated] (SOLR-4066) SolrZKClient changed interface

Posted by "Trym Møller (JIRA)" <ji...@apache.org>.
     [ 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:
{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}

    
> 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


[jira] [Commented] (SOLR-4066) SolrZKClient changed interface

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496307#comment-13496307 ] 

Mark Miller commented on SOLR-4066:
-----------------------------------

Looks like this is a dupe of SOLR-3989? And yonik just committed a fix that simply adds the exception to the runtimeexception.

Any particular reason we should be more granular here Trym?
                
> 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
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4066.patch
>
>
> 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