[
https://issues.apache.org/jira/browse/ZOOKEEPER-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981559#comment-15981559
]
ASF GitHub Bot commented on ZOOKEEPER-2697:
-------------------------------------------
Github user hanm commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/222#discussion_r113008904
--- 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 {
--- End diff --
no synchronization here?
> 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)