From dev-return-40926-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Oct 24 16:32:46 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 D7CDA180638 for ; Wed, 24 Oct 2018 16:32:45 +0200 (CEST) Received: (qmail 62404 invoked by uid 500); 24 Oct 2018 14:32:44 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 62385 invoked by uid 99); 24 Oct 2018 14:32:44 -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; Wed, 24 Oct 2018 14:32:44 +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 DB066180D69 for ; Wed, 24 Oct 2018 14:32:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.388 X-Spam-Level: ** X-Spam-Status: No, score=2.388 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 mFBGmMLj3eug for ; Wed, 24 Oct 2018 14:32:42 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 33F125F36F for ; Wed, 24 Oct 2018 14:32:42 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id w19-v6so5283321eds.1 for ; Wed, 24 Oct 2018 07:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=bjb/DQhCiIWKIWAkKFPcU5MyqxvoaqRNXjbRsHb1DY0=; b=pQ2Eu38dfFHE5e3kSlNZsFDvY39D6vA5In/gJtl+D5dbXYA+8rZfDT8ARJqqdjzjEJ lFWXrkLpZsWvxVglkFWOf/VpcSHeJO3qQ/ir/O6p/+Qn9rxoxGQ4LECqdLLjelgJadgK Hm/9z4ExOZ7FVdVhGdw7vwiywDRUBQiOdRS7N7ejgfiYo1wm8DcxKFcRgSdPExav1iu7 AUcG0rCJzY1cqwCQFy+rtvue7xxc7Cvgukb0u+ZYvTGLg2PxI1TNGBXkWbUjJJZ1za98 PUKnFMi6vOmzu5Dj2aO1wbT71C/KHcFz9sArOWfTlZyt/UxcwaUe1ohlt14+7MahSpq4 w2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bjb/DQhCiIWKIWAkKFPcU5MyqxvoaqRNXjbRsHb1DY0=; b=T2nQyrjOKDeLVls2QGxb10K7a3IuV4eDyYXzXE+1/s6ipTDc20S9Jg8h7uwP0rl2AR bH+T8CbFHOQ5+p7lTE9tqfZLGB66ZL5+7ko1eoqAabDn8o+7xJxgMJJqdVR4Dvceee1j JIYFaU5bOkQ4EvgUoCv9GxV3XC2O44e5H/MuadzrPM8nyHrTP6tmyVDqpqDy4i1d41HC hE1QOYzK8LpfYJ+yh1XTkXQYCwWogbLZTpjVkI1GaY9k8AiI5nwzPevIX/U/kMWVuu14 6MymPYP3bYLLl+VLkhZr1bfL7l53ESC8fP2qqlGVmD++kUsLnTxDNo319+SRoLvqpaLK BILw== X-Gm-Message-State: AGRZ1gIFcQ+5ycV916HmpRCYNRuE6ooZ7k3TsAyvKTBxrCVJPus225ph lBkOKlPCsfVhgjoAkLTtx5GOwZaC9RRBo5yS4gP+FxFB X-Google-Smtp-Source: AJdET5fPI7mLkpl7dVCmfria2F6NglUpxzcjbS15DYCxDBI+nxgwytZmJ51yKSXHwzmIrWFkEADnqPd5mer6EX+D4ZA= X-Received: by 2002:a17:906:9d1:: with SMTP id r17-v6mr1189355eje.51.1540391555868; Wed, 24 Oct 2018 07:32:35 -0700 (PDT) MIME-Version: 1.0 From: Michael Fong Date: Wed, 24 Oct 2018 22:32:24 +0800 Message-ID: Subject: Problem with reading incomplete payload - IGNITE-7153 To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="00000000000080aa800578fa5bb2" --00000000000080aa800578fa5bb2 Content-Type: text/plain; charset="UTF-8" Hi, all, I was trying to fix IGNITE-7153 which relates to parsing incomplete REDIS packet larger than 8192 bytes. However, I found a random problem which is reproducible on TC as well. That said, GridNioServerRead.processRead() : - int cnt = sockCh.read(readBuf); sometimes does not read the payload fully as the length field in the header is larger than the ByteBuffer.limit(). As the result, the BufferUnderFlowException will be thrown. For example, in a erroneous round run with my IDE, a REDIS payload (sent by jedis client) looks like the following: 2a 33 d a 24 33 d a 53 45 54 d a 24 32 d a 62 31 d a 24 {38 31 39 32} d a | 65 d a ...etc GridRedisProtocolParser.readBulkStr(buf) invokes elCnt(buf) which gets {8192}. However, the limit of buf is 28 which ends at | position. Obviously, 8192 < limit(), therefore, the logic throws BufferUnderFlow soon after. I traced back and found sockCh.read(readBuf) only read 28 bytes for unknown reason The problem seems totally random. I wonder if this has anything to do with other NioWorker or Selector setting. Any help would be appreciated! Regards, Michael --00000000000080aa800578fa5bb2--