From issues-return-111-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Jun 14 09:23:02 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id AA88518067E for ; Fri, 14 Jun 2019 11:23:02 +0200 (CEST) Received: (qmail 18348 invoked by uid 500); 14 Jun 2019 09:23:01 -0000 Mailing-List: contact issues-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 issues@zookeeper.apache.org Received: (qmail 18251 invoked by uid 99); 14 Jun 2019 09:23:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2019 09:23:01 +0000 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 95C1AE2CDF for ; Fri, 14 Jun 2019 09:23:00 +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 5095E2463B for ; Fri, 14 Jun 2019 09:23:00 +0000 (UTC) Date: Fri, 14 Jun 2019 09:23:00 +0000 (UTC) From: "Hudson (JIRA)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-3296) Cannot join quorum due to Quorum SSLSocket connection not closed explicitly when there is handshake issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-3296?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16863876#comment-16863876 ]=20 Hudson commented on ZOOKEEPER-3296: ----------------------------------- SUCCESS: Integrated in Jenkins build ZooKeeper-trunk #569 (See [https://bui= lds.apache.org/job/ZooKeeper-trunk/569/]) ZOOKEEPER-3296: Explicitly closing the sslsocket when it failed (eolivelli:= rev 5874a0f355417024ce8ebe03ab2f6eaf5b9a228c) * (edit) zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/= QuorumCnxManager.java * (add) zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/C= nxManagerTest.java * (edit) zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/= QuorumPeer.java * (delete) zookeeper-server/src/test/java/org/apache/zookeeper/test/CnxMana= gerTest.java > Cannot join quorum due to Quorum SSLSocket connection not closed explicit= ly when there is handshake issue > -------------------------------------------------------------------------= -------------------------------- > > Key: ZOOKEEPER-3296 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3296 > Project: ZooKeeper > Issue Type: Bug > Components: server > Affects Versions: 3.5.4, 3.6.0 > Reporter: Fangmin Lv > Assignee: Fangmin Lv > Priority: Major > Labels: pull-request-available > Fix For: 3.6.0 > > Time Spent: 2h 20m > Remaining Estimate: 0h > > Recently, on prod ensembles, we saw some peers failed to connect to other= s due to timed out when connecting to the other's leader election port. Thi= s was triggered by a network incident with lots of packet loss. > After investigation, we found it's because we=C2=A0doesn't close the sock= et explicitly when it timed out during ssl handshake in QuorumCnxManager.co= nnectOne. > The quorum connection manager is handling connections sequentially with a= default listen backlog queue size 50, during the network loss, there are s= ocket read timed out, which is syncLimit * tickTime, and almost all the fol= lowing connect requests in the backlog queue will timed out from the other = side before it's being processed. Those timed out learners=C2=A0will try to= connect to a different server, and leaves the connect requests on server s= ide without sending the close_notify packet. The server is slowly consuming= from these queue with syncLimit * tickTime timeout for each of those reque= sts which haven't sent notify_close packet. Any new connect requests will b= e queued up again when there is spot in the listen backlog queue, but timed= out before the server handles it, and it can never successfully finish any= new connection, so it failed to join the quorum. And=C2=A0the peers are=C2= =A0leaking FD because all those connections are in CLOSE-WAIT state. > =C2=A0 > Restarting the servers to drain the listen backlog queue mitigated the i= ssue. > Here are the steps to manually reproduce the issue: > # issuing two telnet connect to server A in the quorum without sending a= ny packet > # stop all other servers > # start those again > # server A read timed out from those telnet connect request one by one a= nd it cannot join the quorum anymore -- This message was sent by Atlassian JIRA (v7.6.3#76005)