From issues-return-269-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Jul 2 16:31:03 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 BECCE180778 for ; Tue, 2 Jul 2019 18:31:02 +0200 (CEST) Received: (qmail 96175 invoked by uid 500); 2 Jul 2019 16:31:02 -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 96165 invoked by uid 99); 2 Jul 2019 16:31:02 -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; Tue, 02 Jul 2019 16:31:02 +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 08483E2E7D for ; Tue, 2 Jul 2019 16:31:01 +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 7C7FA261DA for ; Tue, 2 Jul 2019 16:31:00 +0000 (UTC) Date: Tue, 2 Jul 2019 16:31:00 +0000 (UTC) From: "Hudson (JIRA)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-3240) Close socket on Learner shutdown to avoid dangling socket 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-3240?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16877121#comment-16877121 ]=20 Hudson commented on ZOOKEEPER-3240: ----------------------------------- SUCCESS: Integrated in Jenkins build Zookeeper-trunk-single-thread #431 (Se= e [https://builds.apache.org/job/Zookeeper-trunk-single-thread/431/]) ZOOKEEPER-3240: Close socket on Learner shutdown to avoid dangling so=E2=80= =A6 (andor: rev 96eefafce7ed036d3ab4a7a6d43792ce433bbfad) * (edit) zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/= QuorumPeerMainTest.java * (edit) zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/= Follower.java * (edit) zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/= ReconfigFailureCasesTest.java * (edit) zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/= Learner.java * (edit) zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/= Observer.java > Close socket on Learner shutdown to avoid dangling socket > --------------------------------------------------------- > > Key: ZOOKEEPER-3240 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3240 > Project: ZooKeeper > Issue Type: Improvement > Components: server > Affects Versions: 3.6.0 > Reporter: Brian Nixon > Assignee: Brian Nixon > Priority: Minor > Labels: pull-request-available > Fix For: 3.6.0 > > Time Spent: 3h > Remaining Estimate: 0h > > There was a Learner that had two connections to the Leader after that Lea= rner hit an unexpected exception during flush txn to disk, which will shutd= own previous follower instance and restart a new one. > =C2=A0 > {quote}2018-10-26 02:31:35,568 ERROR [SyncThread:3:ZooKeeperCriticalThrea= d@48] - Severe unrecoverable error, from thread : SyncThread:3 > java.io.IOException: Input/output error > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.base/sun.nio.ch.FileDi= spatcherImpl.force0(Native Method) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.base/sun.nio.ch.FileDi= spatcherImpl.force(FileDispatcherImpl.java:72) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at java.base/sun.nio.ch.FileCh= annelImpl.force(FileChannelImpl.java:395) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.zookeeper.server= .persistence.FileTxnLog.commit(FileTxnLog.java:457) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.zookeeper.server= .persistence.FileTxnSnapLog.commit(FileTxnSnapLog.java:548) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.zookeeper.server= .ZKDatabase.commit(ZKDatabase.java:769) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.zookeeper.server= .SyncRequestProcessor.flush(SyncRequestProcessor.java:246) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.zookeeper.server= .SyncRequestProcessor.run(SyncRequestProcessor.java:172) > 2018-10-26 02:31:35,568 INFO=C2=A0 [SyncThread:3:ZooKeeperServerListenerI= mpl@42] - Thread SyncThread:3 exits, error code 1 > 2018-10-26 02:31:35,568 INFO [SyncThread:3:SyncRequestProcessor@234] - Sy= ncRequestProcessor exited!{quote} > =C2=A0 > It is supposed to close the previous socket, but it doesn't seem to be do= ne anywhere in the code. This leaves the socket open with no one reading fr= om it, and caused the queue full and blocked on sender. > =C2=A0 > Since the LearnerHandler didn't shutdown gracefully, the learner queue si= ze keeps growing, the JVM heap size on leader keeps growing and added press= ure to the GC, and cause high GC time and latency in the quorum. > =C2=A0 > The simple fix is to gracefully shutdown the socket. -- This message was sent by Atlassian JIRA (v7.6.3#76005)