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 05D3F17DAA for ; Mon, 27 Apr 2015 21:06:39 +0000 (UTC) Received: (qmail 41919 invoked by uid 500); 27 Apr 2015 21:06:38 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 41862 invoked by uid 500); 27 Apr 2015 21:06:38 -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 41850 invoked by uid 99); 27 Apr 2015 21:06:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 21:06:38 +0000 Date: Mon, 27 Apr 2015 21:06:38 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-164) curator-x-discovery: unregisterService is not guaranteed to remove the service, due to reconnectListener concurrency issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14514999#comment-14514999 ] Jordan Zimmerman commented on CURATOR-164: ------------------------------------------ * There are lots of classes named Entry. So, I disagree * "Should updateService be throwing an Exception" - I thought about that too. In the old implementation, you'd get a KeeperException.NoNode when setData() was called. In the new implementation, we need to get the Entry instance in order to get the service. So, this seems like a reasonable change. * "internalUnregisterService, that looks almost like a double-checked locking" - but it's not. Just making sure we don't get an NPE. > curator-x-discovery: unregisterService is not guaranteed to remove the service, due to reconnectListener concurrency issue > -------------------------------------------------------------------------------------------------------------------------- > > Key: CURATOR-164 > URL: https://issues.apache.org/jira/browse/CURATOR-164 > Project: Apache Curator > Issue Type: Bug > Components: Framework > Affects Versions: 2.7.0 > Reporter: Rasmus Berg Palm > Assignee: Jordan Zimmerman > Priority: Critical > Fix For: 2.8.0 > > > In ServiceDiscoveryImpl: > When unregistering a service, the reconnect listener might fire while deleting the path. > This can cause a condition where the delete finishes successfully, the service is removed from services, and then the reRegisterServices completes successfully and the service is added back in ZK and in services, end result being that the service was not removed, even though unregisterService did not throw any exceptions. > Essentially the use of the internal 'services' cache makes for a nightmare of concurrency issues. I put this as critical as the library it's really not usable IMO. -- This message was sent by Atlassian JIRA (v6.3.4#6332)