From hdfs-issues-return-230513-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Thu Aug 23 21:06:04 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 6044F180679 for ; Thu, 23 Aug 2018 21:06:04 +0200 (CEST) Received: (qmail 78910 invoked by uid 500); 23 Aug 2018 19:06: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 78899 invoked by uid 99); 23 Aug 2018 19:06:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2018 19:06:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DEF76CA395 for ; Thu, 23 Aug 2018 19:06:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3v-1PCUm1RT5 for ; Thu, 23 Aug 2018 19:06: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 3DADC5F416 for ; Thu, 23 Aug 2018 19:06: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 813D9E0DAA for ; Thu, 23 Aug 2018 19:06: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 23A9C2468F for ; Thu, 23 Aug 2018 19:06:00 +0000 (UTC) Date: Thu, 23 Aug 2018 19:06:00 +0000 (UTC) From: "James Clampffer (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-13745) libhdfs++: Fix race in FileSystem destructor 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-13745?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1659= 0702#comment-16590702 ]=20 James Clampffer commented on HDFS-13745: ---------------------------------------- Thanks for checkout this out [~anatoli.shein]. {quote}Is there a possibility that some task executed by the IoService will= run forever? {quote} Yes.=C2=A0 Someone can pass in a callback that does a long sleep or busy wa= it.=C2=A0 There's plenty of comments that say you should never pass in a ca= llback that can block for an indeterminate amount of time; there's nothing = the library can do if someone chooses to ignore those.=C2=A0 All of the int= ernal tasks that the library runs in the ioservice context have timeouts to= prevent them from running forever. {quote}Should we add some timeout in BlockingStop method if we have been wa= iting too long? {quote} No. BlockingStop is only there to prevent a thread self-join (and only bloc= ks if that's what would happen otherwise).=C2=A0 The only thing exiting the= loop early can do is let the self join happen. On the surface it looks lik= e you could spawn another thread and run the dtor there but then you're sti= ck with a similar issue when it comes to managing the lifetime of that thre= ad. {quote}In the hdfs_ioservice_test in longRunningCallback we sleep for just = 1 second, which might not be enough since if there is some sort of system d= elay longer than 1 second the test might fail. Even though with any amount = of sleep there is a chance of this happening, it might make sense to increa= se it to 2-3 seconds. {quote} Increasing the sleep to 2 or 3 seconds seems just as arbitrary as a 1 secon= d sleep. I'll see if I can get rid of the sleep by adding an extra conditio= n variable. =C2=A0 bq. Also, can we submit another CI run for this? Looks like the previous on= e didn't run for some reason. Yeah. I'll do that once I add the condition variable. =C2=A0 > libhdfs++: Fix race in FileSystem destructor > -------------------------------------------- > > Key: HDFS-13745 > URL: https://issues.apache.org/jira/browse/HDFS-13745 > Project: Hadoop HDFS > Issue Type: Task > Components: native > Reporter: James Clampffer > Assignee: James Clampffer > Priority: Major > Attachments: HDFS-13745.000.patch > > > Whatever happens to have the last shared_ptr to the IoService will run ~I= oService when the shared_ptr goes out of scope.=C2=A0 IoService's destructo= r is responsible for joining all worker threads in the pool.=C2=A0 Most cal= lbacks now own weak_ptr that can be promoted to a shared_ptr in = order to post new async tasks.=C2=A0 If a callback object is the last thing= holding the IoService shared_ptr it's going to try to join the thread pool= inside of one of the thread pool's threads. -- 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