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

    https://github.com/apache/flink/pull/5062#discussion_r154885503
  
    --- Diff: 
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/Client.java
 ---
    @@ -133,7 +134,7 @@ public String getClientName() {
        }
     
        public CompletableFuture<RESP> sendRequest(final InetSocketAddress 
serverAddress, final REQ request) {
    -           if (shutDown.get()) {
    +           if (!clientShutdownFuture.compareAndSet(null, null)) {
    --- End diff --
    
    Well, I agree that the code looks clearer, but the `compareAndSet` 
guarantees atomicity. While `get()` and then compare, does not.


---

Reply via email to