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 0F7B417AC3 for ; Tue, 21 Apr 2015 01:15:59 +0000 (UTC) Received: (qmail 32692 invoked by uid 500); 21 Apr 2015 01:15:59 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 32647 invoked by uid 500); 21 Apr 2015 01:15:59 -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 32635 invoked by uid 99); 21 Apr 2015 01:15:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 01:15:58 +0000 Date: Tue, 21 Apr 2015 01:15:58 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-168) Error 'Path must start with / character' caused by code 'setNode(event.getName());' in line 487 of LeaderLatch.class source file in which 'event.getName()' sometimes only return the last part of znode path instead of the full path. 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-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14504103#comment-14504103 ] Jordan Zimmerman commented on CURATOR-168: ------------------------------------------ I finally found this. It's a very very old bug indeed. It's caused by a mistake in background protected mode for node creation. If the server successfully creates a Curator-protected node by crashes before returning to the client, Curator will incorrectly set the wrong value for the name field in the background Event causing this problem. > Error 'Path must start with / character' caused by code 'setNode(event.getName());' in line 487 of LeaderLatch.class source file in which 'event.getName()' sometimes only return the last part of znode path instead of the full path. > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: CURATOR-168 > URL: https://issues.apache.org/jira/browse/CURATOR-168 > Project: Apache Curator > Issue Type: Bug > Components: Recipes > Affects Versions: 2.7.0 > Environment: operating system:ubuntu > Reporter: zhaogang > Priority: Blocker > Fix For: 2.7.2 > > Attachments: CURATOR-168.patch > > Original Estimate: 168h > Remaining Estimate: 168h > > We use LeaderLatch for leader election within our several zookeeper clients,but sometimes our leaderLatch stopped to work due to a error "Background exception was not retry-able or retry gave up java.lang.IllegalArgumentException: Path must start with / characte". > To found the reason we tracked the execution of program in class LeaderLatch with debug mode,we found the code "setNode(event.getName());" in line 487 of LeaderLatch.class in which "event.getName()" code sometimes didn't return the full path of the znode but only return the last part of the full path,like "_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068", but the full path should be "/api1/leaders/_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068". > So the when event.getName()=="_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068", the program will fail to go through the codes below: > 1.LeaderLatch.checkLeadership() line 526 > 2.ZKPaths.getNodeFromPath() line 61 > 3.PathUtils.validatePath(path) line 46 > And then the LeaderLatch stopped to work. -- This message was sent by Atlassian JIRA (v6.3.4#6332)