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 0A31820049B for ; Mon, 14 Aug 2017 09:35:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 08909163D57; Mon, 14 Aug 2017 07:35: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 4F0A8163D55 for ; Mon, 14 Aug 2017 09:35:04 +0200 (CEST) Received: (qmail 76074 invoked by uid 500); 14 Aug 2017 07:35:03 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 76058 invoked by uid 99); 14 Aug 2017 07:35: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; Mon, 14 Aug 2017 07:35: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 A1350C0167 for ; Mon, 14 Aug 2017 07:35:02 +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-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 WR2UtpW_WW5z for ; Mon, 14 Aug 2017 07:35: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 695875FB95 for ; Mon, 14 Aug 2017 07:35: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 C5677E08F4 for ; Mon, 14 Aug 2017 07:35: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 134672140B for ; Mon, 14 Aug 2017 07:35:00 +0000 (UTC) Date: Mon, 14 Aug 2017 07:35:00 +0000 (UTC) From: "hebelala (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-430) deletingChildrenIfNeeded maybe cannot delete children completely when multi-client delete concurrently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 14 Aug 2017 07:35:05 -0000 [ https://issues.apache.org/jira/browse/CURATOR-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125336#comment-16125336 ] hebelala commented on CURATOR-430: ---------------------------------- Yes, I have test. Please see the code, and debug it. The debug breakpoints are *step1*, *step2*, and *ZkPaths.deleteChildren -> List children = zookeeper.getChildren(path, null);* {code:java} public static void main(String[] args) { try { TestingServer server = new TestingServer(); server.start(); final CuratorFramework curatorFramework = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).sessionTimeoutMs(600 * 1000).retryPolicy(new RetryNTimes(3, 1000)).build(); curatorFramework.start(); curatorFramework.blockUntilConnected(); curatorFramework.create().creatingParentsIfNeeded().forPath("/a/1"); curatorFramework.create().creatingParentsIfNeeded().forPath("/a/2"); // try to delete /a new Thread(new Runnable() { public void run() { try { // step1 // deleting sequence is: /a/2, /a/1, /a curatorFramework.delete().deletingChildrenIfNeeded().forPath("/a"); } catch (Exception e) { e.printStackTrace(); try { // the /a/1 is existing, because step2 delete /a/2, causes step1 throw NoNodeException(/a/2). It's not expected. Stat stat = curatorFramework.checkExists().forPath("/a/1"); System.out.println("checkExits:" + stat); } catch (Exception e1) { e1.printStackTrace(); } } } }).start(); Thread.sleep(1000L); // step2 // delete /a/2, when step1 try to delete /a/2 and is going to zookeeper.getChildren("/a/2", null) curatorFramework.delete().forPath("/a/2"); System.out.println("ok"); Thread.sleep(1000L); } catch (Exception e) { e.printStackTrace(); } finally { System.exit(0); } } {code} > deletingChildrenIfNeeded maybe cannot delete children completely when multi-client delete concurrently > ------------------------------------------------------------------------------------------------------ > > Key: CURATOR-430 > URL: https://issues.apache.org/jira/browse/CURATOR-430 > Project: Apache Curator > Issue Type: Bug > Components: Client > Reporter: hebelala > > use curatorFramework.delete().deletingChildrenIfNeeded().forPath(path), this sync api doesn't ignore the NoNodeException, causes the rest of children nodes will not be deleted perhaps. > zookeeper.getChildren(path, null) maybe throw NoNodeException, if the path doesn't exist. -- This message was sent by Atlassian JIRA (v6.4.14#64029)