From hdfs-issues-return-212022-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Mar 6 17:26: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 57AB7180677 for ; Tue, 6 Mar 2018 17:26:04 +0100 (CET) Received: (qmail 27087 invoked by uid 500); 6 Mar 2018 16:26: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 27068 invoked by uid 99); 6 Mar 2018 16:26: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; Tue, 06 Mar 2018 16:26: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 D3990C012E for ; Tue, 6 Mar 2018 16:26:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id T9FicLJbgpHf for ; Tue, 6 Mar 2018 16:26:01 +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 6DCE75F3F0 for ; Tue, 6 Mar 2018 16:26: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 C8433E030E for ; Tue, 6 Mar 2018 16:26: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 3AF522127A for ; Tue, 6 Mar 2018 16:26:00 +0000 (UTC) Date: Tue, 6 Mar 2018 16:26:00 +0000 (UTC) From: "Anatoli Shein (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11807) libhdfs++: Get minidfscluster tests running under valgrind 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/HDFS-11807?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1638= 8044#comment-16388044 ]=20 Anatoli Shein commented on HDFS-11807: -------------------------------------- Thanks for another review, [~James C]! In the new patch (009) I have addressed your comments as follows: -check the return code on the socketpair() call (/) Done. =C2=A0 -You can't assume a file descriptor is going to be in the range [0,255]; yo= u'll often get this for a process that has just spawned but that's just som= e luck. If the upper bit is set it's also going to be explicitly sign exten= ded when it's promoted to a wider type which can make things a little confu= sing to debug. I'd also convert the binary value to a string or hex encodin= g because if the least significant byte of an int is 0 that's going to trea= ted as a null terminator. {code:java} // The argument contains child socket fd[childsocket] =3D (int)argv[1][0]; {code} (/) Fixed: I am passing it as a string now. =C2=A0 -Since we're sharing this test with libhdfs which can build on windows we c= an't unconditionally include headers that windows won't have. Since this te= st also leans heavily on *nix style process management e.g. fork() it might= be best to just avoid building this test on windows. {code:java} #include {code} (i) Agreed, eventually we might look into making this test windows compatib= le. =C2=A0 Nitpicky stuff, not blockers but would clean things up a little: -Don't need an extra cast when calling free() {code:java} free((char*)httpHost); {code} (/) Done. =C2=A0 Same idea when writing httpHost over the socket {code:java} ASSERT_INT64_EQ(read(fd[parentsocket], (char*)httpHost, hostSize), hostSize= ); {code} (/) Done. =C2=A0 -I'd change "fd[]" so "fds" or something plural to make it's clear that it'= s an array since a lot of C examples will name a single descriptor "fd". Yo= u can also just make a single int variable at the top of main() that gets a= ssigned the appropriate side of the pair once you've forked just to avoid i= ndexing (you'll still need the array to pass to socketpair). (/) Fixed: changed name from fd to fds. > libhdfs++: Get minidfscluster tests running under valgrind > ---------------------------------------------------------- > > Key: HDFS-11807 > URL: https://issues.apache.org/jira/browse/HDFS-11807 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: hdfs-client > Reporter: James Clampffer > Assignee: Anatoli Shein > Priority: Major > Attachments: HDFS-11807.HDFS-8707.000.patch, HDFS-11807.HDFS-8707= .001.patch, HDFS-11807.HDFS-8707.002.patch, HDFS-11807.HDFS-8707.003.patch,= HDFS-11807.HDFS-8707.004.patch, HDFS-11807.HDFS-8707.005.patch, HDFS-11807= .HDFS-8707.006.patch, HDFS-11807.HDFS-8707.007.patch, HDFS-11807.HDFS-8707.= 008.patch, HDFS-11807.HDFS-8707.009.patch > > > The gmock based unit tests generally don't expose race conditions and mem= ory stomps. A good way to expose these is running libhdfs++ stress tests a= nd tools under valgrind and pointing them at a real cluster. Right now the= CI tools don't do that so bugs occasionally slip in and aren't caught unti= l they cause trouble in applications that use libhdfs++ for HDFS access. > The reason the minidfscluster tests don't run under valgrind is because t= he GC and JIT compiler in the embedded JVM do things that look like errors = to valgrind. I'd like to have these tests do some basic setup and then for= k into two processes: one for the minidfscluster stuff and one for the libh= dfs++ client test. A small amount of shared memory can be used to provide = a place for the minidfscluster to stick the hdfsBuilder object that the cli= ent needs to get info about which port to connect to. Can also stick a con= dition variable there to let the minidfscluster know when it can shut down. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org