From dev-return-78982-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu Mar 7 13:37:07 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D71C7180654 for ; Thu, 7 Mar 2019 14:37:06 +0100 (CET) Received: (qmail 28805 invoked by uid 500); 7 Mar 2019 13:37:05 -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 28794 invoked by uid 99); 7 Mar 2019 13:37:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2019 13:37:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 703FD1808A3 for ; Thu, 7 Mar 2019 13:37:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.55 X-Spam-Level: X-Spam-Status: No, score=-109.55 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_LOTSOFHASH=0.25, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id QK0f6y8igDSS for ; Thu, 7 Mar 2019 13:37:01 +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 69F3D60DA2 for ; Thu, 7 Mar 2019 13:37:01 +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 7DAE1E282A for ; Thu, 7 Mar 2019 13:37: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 397A325776 for ; Thu, 7 Mar 2019 13:37:00 +0000 (UTC) Date: Thu, 7 Mar 2019 13:37:00 +0000 (UTC) From: "Josh Elser (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-3253) client should not send requests with cxid=-4, -2, or -1 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-3253?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16786771#comment-16786771 ]=20 Josh Elser commented on ZOOKEEPER-3253: --------------------------------------- FWIW, I had pulled this change into a fork and ran into the same issue. I a= ssumed it was an issue with my fork :) {code:java} diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.= java b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java index 03c8b0d7e..0577d5f15 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java @@ -448,12 +448,21 @@ public ZooKeeper(String connectString, int sessionTim= eout, Watcher watcher, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 connectString); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 HostProvider hostProvider = =3D new StaticHostProvider( =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 connectStringParser.getServerAddresses()); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cnxn =3D new ClientCnxn(connect= StringParser.getChrootPath(), +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cnxn =3D createConnection(conne= ctStringParser.getChrootPath(), =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 hostProvider, sessionTimeout, this, watchManager, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 getClientCnxnSocket(), canBeReadOnly); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cnxn.start(); =C2=A0=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0 // @VisibleForTesting +=C2=A0=C2=A0=C2=A0 protected ClientCnxn createConnection(String chrootPath= , +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 HostPro= vider hostProvider, int sessionTimeout, ZooKeeper zooKeeper, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ClientW= atchManager watcher, ClientCnxnSocket clientCnxnSocket, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 boolean= canBeReadOnly) throws IOException { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return new ClientCnxn(chrootPat= h, hostProvider, sessionTimeout, this, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 watchManager, clientCnxnSocket, canBeReadOnly); +=C2=A0=C2=A0=C2=A0 } + =C2=A0=C2=A0=C2=A0=C2=A0 /** =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * To create a ZooKeeper client object, the a= pplication needs to pass a =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * connection string containing a comma separ= ated list of host:port pairs,{code} Just missing the "hook" to inject a custom {{ClientCnxn}} object that the t= est code relies on. (Can send this as a PR, just didn't want to steal [~sjust2]'s thunder ;)) > client should not send requests with cxid=3D-4, -2, or -1 > ------------------------------------------------------- > > Key: ZOOKEEPER-3253 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3253 > Project: ZooKeeper > Issue Type: Bug > Components: java client > Affects Versions: 3.4.9, 3.5.4, 3.6.0 > Reporter: Samuel Just > Assignee: Samuel Just > Priority: Minor > Labels: pull-request-available > Fix For: 3.6.0, 3.5.5, 3.4.15 > > Original Estimate: 48h > Time Spent: 4h 50m > Remaining Estimate: 43h 10m > > Once the cxid value increments to -4, the client will interpret the respo= nse as an auth packet rather than as a response to a request and will trans= parently drop the response and the request will hang.=C2=A0 Similarly, -2 w= ill be seen as a ping and will be dropped hanging the request.=C2=A0 -1 sho= ws up as a WatcherEvent and results in the error below. > =C2=A0 > {quote}2019-01-07T21:58:23.209+00:00 [INFO ] [main-SendThread(mnds1-2-phx= .ops.sfdc.net:2181)] [ClientCnxn.java:1381] [:] - Session establishment com= plete on server mnds1-2-phx.ops.sfdc.net/10.246.244.71:2181, sessionid =3D = 0x267859729d66320, negotiated timeout =3D 10000 > 2019-01-07T21:58:22.281+00:00 20190107215822.281000 [WARN ] [main-SendTh= read(mnds1-3-phx.ops.sfdc.net:2181)] [ClientCnxn.java:1235] [:] - Session 0= x267859729d66320 for server mnds1-3-phx.ops.sfdc.net/10.246.244.69:2181, un= expected error, closing socket connection and attempting reconnect > java.io.IOException: Unreasonable length =3D 892612659 > at org.apache.jute.BinaryInputArchive.checkLength(BinaryInputArchive.jav= a:127) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b4= 2864475a60] > at org.apache.jute.BinaryInputArchive.readString(BinaryInputArchive.java= :81) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b428= 64475a60] > at org.apache.zookeeper.proto.WatcherEvent.deserialize(WatcherEvent.java= :66) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b428= 64475a60] > at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.ja= va:839) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b= 42864475a60] > at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.jav= a:101) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b4= 2864475a60] > at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocket= NIO.java:363) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a= 47e06b42864475a60] > at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214) = ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475= a60] > {quote} > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)