From dev-return-68357-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Mar 26 03:34:08 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 DB93618063B for ; Mon, 26 Mar 2018 03:34:07 +0200 (CEST) Received: (qmail 63083 invoked by uid 500); 26 Mar 2018 01:34:06 -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 63072 invoked by uid 99); 26 Mar 2018 01:34:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2018 01:34:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B6F02C0249 for ; Mon, 26 Mar 2018 01:34:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Knaiki1vVWHB for ; Mon, 26 Mar 2018 01:34:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AA67B5FB55 for ; Mon, 26 Mar 2018 01:34:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2A094E0D08 for ; Mon, 26 Mar 2018 01:34:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2A0E9214FD for ; Mon, 26 Mar 2018 01:34:01 +0000 (UTC) Date: Mon, 26 Mar 2018 01:34:01 +0000 (UTC) From: "Michael Han (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ZOOKEEPER-1159) ClientCnxn does not propagate session expiration indication MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Han updated ZOOKEEPER-1159: ----------------------------------- Priority: Major (was: Blocker) > ClientCnxn does not propagate session expiration indication > ----------------------------------------------------------- > > Key: ZOOKEEPER-1159 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1159 > Project: ZooKeeper > Issue Type: Bug > Components: java client > Affects Versions: 3.4.0 > Reporter: Andrew Purtell > Assignee: Andor Molnar > Priority: Major > Fix For: 3.5.4, 3.6.0 > > > ClientCnxn does not always propagate session expiration indication up to clients. If a reconnection attempt fails because the session has since expired, the KeeperCode is still Disconnected, but shouldn't it be set to Expired? Perhaps like so: > {code} > --- a/src/java/main/org/apache/zookeeper/ClientCnxn.java > +++ b/src/java/main/org/apache/zookeeper/ClientCnxn.java > @@ -1160,6 +1160,7 @@ public class ClientCnxn { > clientCnxnSocket.doTransport(to, pendingQueue, outgoingQueue); > > } catch (Exception e) { > + Event.KeeperState eventState = Event.KeeperState.Disconnected; > if (closing) { > if (LOG.isDebugEnabled()) { > // closing so this is expected > @@ -1172,6 +1173,7 @@ public class ClientCnxn { > // this is ugly, you have a better way speak up > if (e instanceof SessionExpiredException) { > LOG.info(e.getMessage() + ", closing socket connection"); > + eventState = Event.KeeperState.Expired; > } else if (e instanceof SessionTimeoutException) { > LOG.info(e.getMessage() + RETRY_CONN_MSG); > } else if (e instanceof EndOfStreamException) { > @@ -1191,7 +1193,7 @@ public class ClientCnxn { > if (state.isAlive()) { > eventThread.queueEvent(new WatchedEvent( > Event.EventType.None, > - Event.KeeperState.Disconnected, > + eventState, > null)); > } > clientCnxnSocket.updateNow(); > {code} > This affects HBase. HBase master and region server processes will shut down by design if their session has expired, but will attempt to reconnect if they think they have been disconnected. The above prevents proper termination. -- This message was sent by Atlassian JIRA (v7.6.3#76005)