From issues-return-5572-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu May 6 15:53:02 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 8A4B518060E for ; Thu, 6 May 2021 17:53:02 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 0921A605A7 for ; Thu, 6 May 2021 15:53:01 +0000 (UTC) Received: (qmail 40790 invoked by uid 500); 6 May 2021 15:53: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 40778 invoked by uid 99); 6 May 2021 15:53:01 -0000 Received: from ec2-52-204-25-47.compute-1.amazonaws.com (HELO mailrelay1-ec2-va.apache.org) (52.204.25.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 May 2021 15:53:01 +0000 Received: from jira2-he-de.apache.org (jira2-he-de.apache.org [168.119.33.54]) by mailrelay1-ec2-va.apache.org (ASF Mail Server at mailrelay1-ec2-va.apache.org) with ESMTPS id 0F6D33E9D8 for ; Thu, 6 May 2021 15:53:01 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 3F253C8063A for ; Thu, 6 May 2021 15:53:00 +0000 (UTC) Date: Thu, 6 May 2021 15:53:00 +0000 (UTC) From: "Prathyusha (Jira)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-4236) Java Client SendThread create many unnecessary Login objects 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-4236?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 17340277#comment-17340277 ]=20 Prathyusha commented on ZOOKEEPER-4236: --------------------------------------- [~dbwong], I am picking this up. Can someone assign this to me please? > Java Client SendThread create many unnecessary Login objects > ------------------------------------------------------------ > > Key: ZOOKEEPER-4236 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4236 > Project: ZooKeeper > Issue Type: Bug > Reporter: Daniel Wong > Priority: Minor > > Hi I am an Apache Phoenix committer and I help manage many many zookeeper= clusters at my employment primarily using ZK for HBase use cases.=C2=A0 We= recently had a production incident where some of our ACLs were not setup p= reventing connectivity from the client to the ZK nodes and the failure path= exposed 2 issues to fix. This Jira and ZooKeeper-4235.=C2=A0 This Jira is = the less important of the 2 and handles numerous objects.=C2=A0 We had hund= reds of threads per JVM with the following stack trace.=C2=A0=C2=A0 > {code:java} > java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketConnec= t(java.base@11.0.4.0.101/Native Method) at java.net.AbstractPlainSocketImpl= .doConnect(java.base@11.0.4.0.101/AbstractPlainSocketImpl.java:399) - locke= d <0x00000015004fde20> (a java.net.SocksSocketImpl) at java.net.AbstractPla= inSocketImpl.connectToAddress(java.base@11.0.4.0.101/AbstractPlainSocketImp= l.java:242) at java.net.AbstractPlainSocketImpl.connect(java.base@11.0.4.0.= 101/AbstractPlainSocketImpl.java:224) at java.net.SocksSocketImpl.connect(j= ava.base@11.0.4.0.101/SocksSocketImpl.java:403) at java.net.Socket.connect(= java.base@11.0.4.0.101/Socket.java:609) at sun.security.krb5.internal.TCPCl= ient.(java.security.jgss@11.0.4.0.101/NetClient.java:62) at sun.secur= ity.krb5.internal.NetClient.getInstance(java.security.jgss@11.0.4.0.101/Net= Client.java:42) at sun.security.krb5.KdcComm$KdcCommunication.run(java.secu= rity.jgss@11.0.4.0.101/KdcComm.java:401) at sun.security.krb5.KdcComm$KdcCo= mmunication.run(java.security.jgss@11.0.4.0.101/KdcComm.java:364) at java.s= ecurity.AccessController.doPrivileged(java.base@11.0.4.0.101/Native Method)= at sun.security.krb5.KdcComm.send(java.security.jgss@11.0.4.0.101/KdcComm.= java:348) at sun.security.krb5.KdcComm.sendIfPossible(java.security.jgss@11= .0.4.0.101/KdcComm.java:253) at sun.security.krb5.KdcComm.send(java.securit= y.jgss@11.0.4.0.101/KdcComm.java:234) at sun.security.krb5.KdcComm.send(jav= a.security.jgss@11.0.4.0.101/KdcComm.java:200) at sun.security.krb5.KrbAsRe= qBuilder.send(java.security.jgss@11.0.4.0.101/KrbAsReqBuilder.java:326) at = sun.security.krb5.KrbAsReqBuilder.action(java.security.jgss@11.0.4.0.101/Kr= bAsReqBuilder.java:371) at com.sun.security.auth.module.Krb5LoginModule.att= emptAuthentication(jdk.security.auth@11.0.4.0.101/Krb5LoginModule.java:754)= at com.sun.security.auth.module.Krb5LoginModule.login(jdk.security.auth@11= .0.4.0.101/Krb5LoginModule.java:592) at javax.security.auth.login.LoginCont= ext.invoke(java.base@11.0.4.0.101/LoginContext.java:726) at javax.security.= auth.login.LoginContext$4.run(java.base@11.0.4.0.101/LoginContext.java:665)= at javax.security.auth.login.LoginContext$4.run(java.base@11.0.4.0.101/Log= inContext.java:663) at java.security.AccessController.doPrivileged(java.bas= e@11.0.4.0.101/Native Method) at javax.security.auth.login.LoginContext.inv= okePriv(java.base@11.0.4.0.101/LoginContext.java:663) at javax.security.aut= h.login.LoginContext.login(java.base@11.0.4.0.101/LoginContext.java:574) at= org.apache.zookeeper.Login.login(Login.java:304) - locked <0x000000151c477= 148> (a org.apache.zookeeper.Login) at org.apache.zookeeper.Login.(Lo= gin.java:106) at org.apache.zookeeper.client.ZooKeeperSaslClient.createSasl= Client(ZooKeeperSaslClient.java:249) - locked <0x000000151c476f68> (a org.a= pache.zookeeper.client.ZooKeeperSaslClient) at org.apache.zookeeper.client.= ZooKeeperSaslClient.(ZooKeeperSaslClient.java:141) at org.apache.zook= eeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:972) at org.apache= .zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1031) > {code} > Note that these were logging in to our 10 ZK nodes but we had 100s of Log= ins.=C2=A0 In theory=C2=A0we =C2=A0should only need at most 10 Logins.=C2= =A0=C2=A0 > This Jira is intended to improve the behavior in limiting the number of L= ogin objects/clients to the needed number.=C2=A0 Note that a combination of= JIRAs https://issues.apache.org/jira/browse/ZOOKEEPER-2375=C2=A0and https:= //issues.apache.org/jira/browse/ZOOKEEPER-2139=C2=A0=C2=A0removed the singl= eton at the Login level but left in unnecessary synchronization code.=C2=A0= This could be again improved via either a singleton perhaps at the SaslCli= ent layer or some sort of connection -> login cache so that new connections= would reuse/wait for the same objects in failure paths. -- This message was sent by Atlassian Jira (v8.3.4#803005)