From dev-return-67861-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Feb 26 16:58:05 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 D957F18077D for ; Mon, 26 Feb 2018 16:58:04 +0100 (CET) Received: (qmail 75607 invoked by uid 500); 26 Feb 2018 15:58:03 -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 75592 invoked by uid 99); 26 Feb 2018 15:58:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Feb 2018 15:58:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 49A481A0F9A for ; Mon, 26 Feb 2018 15:58:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -102.311 X-Spam-Level: X-Spam-Status: No, score=-102.311 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tjTuXqaSfmd4 for ; Mon, 26 Feb 2018 15:58:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 202285FBA4 for ; Mon, 26 Feb 2018 15:58:02 +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 3703CE0956 for ; Mon, 26 Feb 2018 15:58: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 A135F255D6 for ; Mon, 26 Feb 2018 15:58:00 +0000 (UTC) Date: Mon, 26 Feb 2018 15:58:00 +0000 (UTC) From: "sumit agrawal (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (ZOOKEEPER-2977) Concurrency for addAuth corrupts quorum packets 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-2977?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] sumit agrawal updated ZOOKEEPER-2977: ------------------------------------- Comment: was deleted (was: https://github.com/apache/zookeeper/pull/474) > Concurrency for addAuth corrupts quorum packets > ----------------------------------------------- > > Key: ZOOKEEPER-2977 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2977 > Project: ZooKeeper > Issue Type: Bug > Components: quorum > Affects Versions: 3.4.9 > Environment: Affects all version in 3.4.x > Reporter: sumit agrawal > Priority: Critical > Fix For: 3.4.12 > > Attachments: 2977.patch > > > When client performs multiple times addAuth with different credential at = follower concurrently, the communication between follower gets corrupt. Thi= s causes shutdown of Follower due to the failure. > Analysis: > In=C2=A0org.apache.zookeeper.server.quorum.QuorumPacket.serialize method, > * call=C2=A0a_.startVector(authinfo,"authinfo"); which write the length = of authinfo to packet (suppose it writes length 1) > * get length of authinfo to write all details in loop (here gets length = as 2) > <-- Here in concurrency scenario, buffer gets corrupt having extra bytes = in channel for additional authinfo. > =C2=A0 > So When Leader reads next quorum packet, it reads previous extra bytes (i= ncorrect) and possibly identify greater size of message (as corrupt byte pa= ttern) causes exception... > Coordination > Unexpected exception causing shutdown while sock still ope= n (LearnerHandler.java:633) > java.io.IOException: Unreasonable length =3D 1885430131 > =C2=A0 > =C2=A0 > ServerCnxn.getAuthInfo returns Unmodifiable list, but while addAuthInfo, = there is no check. So this causes concurrency issue. > =C2=A0 > =C2=A0 > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)