From dev-return-70672-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jun 18 16:07:12 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B0279180663 for ; Mon, 18 Jun 2018 16:07:11 +0200 (CEST) Received: (qmail 13076 invoked by uid 500); 18 Jun 2018 14:07:10 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 13064 invoked by uid 99); 18 Jun 2018 14:07:10 -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; Mon, 18 Jun 2018 14:07:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D2294DFB1B; Mon, 18 Jun 2018 14:07:09 +0000 (UTC) From: timothyjward To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #529: [ZOOKEEPER-2368] Send a watch event is when a c... Content-Type: text/plain Message-Id: <20180618140709.D2294DFB1B@git1-us-west.apache.org> Date: Mon, 18 Jun 2018 14:07:09 +0000 (UTC) Github user timothyjward commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/529#discussion_r196090467 --- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java --- @@ -1260,10 +1260,8 @@ public void run() { cleanup(); } clientCnxnSocket.close(); - if (state.isAlive()) { - eventThread.queueEvent(new WatchedEvent(Event.EventType.None, - Event.KeeperState.Disconnected, null)); - } + eventThread.queueEvent(new WatchedEvent(Event.EventType.None, + Event.KeeperState.Closed, null)); --- End diff -- Good catch - in the previous version of this patch the terminal event re-used the disconnected state for closing (hence removing the if check. Now that we have a Closed event the Disconnected event should still be sent if the client is connected at the time of the close. ---