Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1879D1090D for ; Tue, 10 Feb 2015 00:35:22 +0000 (UTC) Received: (qmail 87761 invoked by uid 500); 10 Feb 2015 00:35:22 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 87728 invoked by uid 500); 10 Feb 2015 00:35:22 -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 87717 invoked by uid 99); 10 Feb 2015 00:35:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2015 00:35:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6C4FADFD59; Tue, 10 Feb 2015 00:35:21 +0000 (UTC) From: dkesler To: dev@curator.apache.org Reply-To: dev@curator.apache.org References: In-Reply-To: Subject: [GitHub] curator pull request: Curator 187 Content-Type: text/plain Message-Id: <20150210003521.6C4FADFD59@git1-us-west.apache.org> Date: Tue, 10 Feb 2015 00:35:21 +0000 (UTC) Github user dkesler commented on a diff in the pull request: https://github.com/apache/curator/pull/66#discussion_r24379974 --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/ChildReaper.java --- @@ -173,32 +191,40 @@ public boolean removePath(String path) return paths.remove(PathUtils.validatePath(path)); } - private static ScheduledExecutorService newExecutorService() + public static ScheduledExecutorService newExecutorService() { return ThreadUtils.newFixedThreadScheduledPool(2, "ChildReaper"); } private void doWork() { - for ( String path : paths ) + if (shouldDoWork()) --- End diff -- That race condition is already present with the leader election in the Reaper itself as it could lose leadership after scheduling a check for some time in the future, so this is at least no worse than the current state of things. And the race condition doesn't matter too much anyway as the reapers don't use leader election for correctness, but rather because otherwise you get a bunch of logspam about trying to delete already deleted nodes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---