Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D3B9C200D43 for ; Tue, 21 Nov 2017 16:04:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D2450160BFC; Tue, 21 Nov 2017 15:04:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 24BDC160BED for ; Tue, 21 Nov 2017 16:04:24 +0100 (CET) Received: (qmail 67345 invoked by uid 500); 21 Nov 2017 15:04:24 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 67333 invoked by uid 99); 21 Nov 2017 15:04:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2017 15:04:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7CF611800FE for ; Tue, 21 Nov 2017 15:04:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id lv9ADh44vsfI for ; Tue, 21 Nov 2017 15:04:19 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 71DD75FCCF for ; Tue, 21 Nov 2017 15:04:18 +0000 (UTC) Received: (qmail 66512 invoked by uid 99); 21 Nov 2017 15:04:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2017 15:04:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B5B47F5F65; Tue, 21 Nov 2017 15:04:16 +0000 (UTC) From: zentol To: issues@flink.incubator.apache.org Reply-To: issues@flink.incubator.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #5038: [FLINK-7880][FLINK-7975][FLINK-7974][QS] QS test i... Content-Type: text/plain Message-Id: <20171121150416.B5B47F5F65@git1-us-west.apache.org> Date: Tue, 21 Nov 2017 15:04:16 +0000 (UTC) archived-at: Tue, 21 Nov 2017 15:04:26 -0000 Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/5038#discussion_r152298240 --- Diff: flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/Client.java --- @@ -312,32 +345,43 @@ private void handInChannel(Channel channel) { /** * Close the connecting channel with a ClosedChannelException. */ - private void close() { - close(new ClosedChannelException()); + private CompletableFuture close() { + return close(new ClosedChannelException()); } /** * Close the connecting channel with an Exception (can be {@code null}) * or forward to the established channel. */ - private void close(Throwable cause) { - synchronized (connectLock) { - if (!closed) { - if (failureCause == null) { - failureCause = cause; - } + private CompletableFuture close(Throwable cause) { + CompletableFuture future = new CompletableFuture<>(); + if (connectionShutdownFuture.compareAndSet(null, future)) { + synchronized (connectLock) { + if (!closed) { --- End diff -- this seems unnecessary, doesn't the check at L358 guarantee that the entire branch is only executed once? ---