Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1C7E2200CA8 for ; Thu, 15 Jun 2017 23:28:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1B099160BC9; Thu, 15 Jun 2017 21:28:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 60DBE160BDF for ; Thu, 15 Jun 2017 23:28:04 +0200 (CEST) Received: (qmail 80623 invoked by uid 500); 15 Jun 2017 21:28:03 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 80612 invoked by uid 99); 15 Jun 2017 21:28:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 21:28:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 06C76C1487 for ; Thu, 15 Jun 2017 21:28:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 6WbHa7vgm2a5 for ; Thu, 15 Jun 2017 21:28:02 +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 795E55FC3D for ; Thu, 15 Jun 2017 21:28: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 B7E10E0D57 for ; Thu, 15 Jun 2017 21:28: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 1DDF724002 for ; Thu, 15 Jun 2017 21:28:00 +0000 (UTC) Date: Thu, 15 Jun 2017 21:28:00 +0000 (UTC) From: "Karan Mehta (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11583) Parent spans are not initialized to NullScope for every DFSPacket MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 15 Jun 2017 21:28:05 -0000 [ https://issues.apache.org/jira/browse/HDFS-11583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051089#comment-16051089 ] Karan Mehta commented on HDFS-11583: ------------------------------------ Thank you [~ajisakaa] and [~iwasakims]! > Parent spans are not initialized to NullScope for every DFSPacket > ----------------------------------------------------------------- > > Key: HDFS-11583 > URL: https://issues.apache.org/jira/browse/HDFS-11583 > Project: Hadoop HDFS > Issue Type: Bug > Components: tracing > Affects Versions: 2.7.1 > Reporter: Karan Mehta > Assignee: Masatake Iwasaki > Fix For: 2.7.4 > > Attachments: HDFS-11583-branch-2.7.001.patch, HDFS-11583-branch-2.7.002.patch, HDFS-11583-branch-2.7.003.patch > > > The issue was found while working with PHOENIX-3752. > Each packet received by the {{run()}} method of {{DataStreamer}} class, uses the {{parents}} field of the {{DFSPacket}} to create a new {{dataStreamer}} span, which in turn creates a {{writeTo}} span as its child span. The parents field is initialized when the packet is added to the {{dataQueue}} and the value is initialized from the {{ThreadLocal}}. This is how HTrace handles spans. > A {{TraceScope}} is created and initialized to {{NullScope}} before the loop which runs till the point when the stream is closed. > Consider the following scenario, when the {{dataQueue}} contains multiple packets, only the first of which has a tracing enabled. The scope is initialized to the {{dataStreamer}} scope and a {{writeTo}} span is created as its child, which gets closed once the packet is sent out to a remote datanode. Before {{writeTo}} span is started, the {{dataStreamer}} scope is detached. So calling the close method on it doesn't do anything at the end of loop. > The second iteration will be using the stale value of the {{scope}} variable with a DFSPacket on which tracing is not enabled. This results in generation of an orphan {{writeTo}} spans which are being delivered to the {{SpanReceiver}} as registered in the TraceFramework. This may result in unlimited number of spans being generated and sent out to receiver. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org