zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ZOOKEEPER-2697) Handle graceful stop of ZookKeeper client
Date Wed, 26 Apr 2017 10:15:04 GMT

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

ASF GitHub Bot commented on ZOOKEEPER-2697:
-------------------------------------------

Github user eolivelli commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/222#discussion_r113414762
  
    --- Diff: src/java/main/org/apache/zookeeper/ZooKeeper.java ---
    @@ -1325,6 +1325,23 @@ public synchronized void close() throws InterruptedException {
         }
     
         /**
    +     * Close this client object as the {@link #close() } method.
    +     * This method will wait for internal resources to be released.
    +     *
    +     * @param waitForShutdownTimeoutMs timeout (in milliseconds) to wait for resources
to be released.
    +     * Use zero or a negative value to skip the wait
    +     * @throws InterruptedException
    +     * @return true if waitForShutdownTimeout is greater than zero and all of the resources
have been released
    +     */
    +    public boolean close(int waitForShutdownTimeoutMs) throws InterruptedException {
    +        close();
    +        if (waitForShutdownTimeoutMs > 0) {
    +            return testableWaitForShutdown(waitForShutdownTimeoutMs);
    --- End diff --
    
    @hanm I did not change the testableWaitForShutdown method in order not to break binary
compatibilty with existing subclasses.
    For instance in my projects I use that method in order to achieve the purpose of this
patches,
    If it is not a problem for other users I will change the signature


> Handle graceful stop of ZookKeeper client
> -----------------------------------------
>
>                 Key: ZOOKEEPER-2697
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2697
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: java client
>    Affects Versions: 3.4.9
>            Reporter: Enrico Olivelli
>            Priority: Critical
>
> As seen in ZOOKEEPER-1394 I would like to have the "close"  which waits for all background
activities to  finish.
> In tests the method "testableWaitForShutdown" is used.
> We can add a new ZooKeeper.close(int tineout)  method which will act as testableWaitForShutdown,
joining all support threads.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message