Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/5062#discussion_r153798768 --- Diff: flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/Client.java --- @@ -166,28 +167,57 @@ public String getClientName() { * Shuts down the client and closes all connections. * * <p>After a call to this method, all returned futures will be failed. + * + * @return A {@link CompletableFuture} that will be completed when the shutdown process is done. */ - public void shutdown() { - if (shutDown.compareAndSet(false, true)) { + public CompletableFuture<Void> shutdown() { + final CompletableFuture<Void> newShutdownFuture = new CompletableFuture<>(); --- End diff -- calling shutdown twice in a row will result in a future being returned that never completes.
---