Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 27641 invoked from network); 14 Sep 2010 05:25:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Sep 2010 05:25:51 -0000 Received: (qmail 27214 invoked by uid 500); 14 Sep 2010 05:25:51 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 27074 invoked by uid 500); 14 Sep 2010 05:25:49 -0000 Mailing-List: contact zookeeper-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-user@hadoop.apache.org Delivered-To: mailing list zookeeper-user@hadoop.apache.org Received: (qmail 27065 invoked by uid 99); 14 Sep 2010 05:25:48 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 05:25:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of timrobertson100@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ey0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 05:25:27 +0000 Received: by eydd26 with SMTP id d26so3997102eyd.35 for ; Mon, 13 Sep 2010 22:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fVRNGniPhPwn75mUhviMARLjfquyDELqtsAxuin6L8c=; b=jsZovXa03fnkuHBbEj6spnkF9f6DWakDHNnYyGHdwI+MJV5yRRqBE0OCy45XlBGW4n Q1hosy5vBu4K6bXCZLPkiHf1jFNWMMhcNS+kd1kEfifhmoONWGMa8CAW30Dmn3Rota7k IsI9HdtcYARK9zNfotl+S+XoB865FymKROCo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=u0/hkKInwEr+WEfgOy44+McPYbXi37igvVerBR8JaKktIcVJYZm5U10EOi0l6VksM7 /AToAFTTTEYolwvR3XDpmEcX/DQzF3dh0i1KZYQga8nWNjkokUAU/ikVuSjamWY3Xs4O WhaAL9pn7YsGTB6Yr1MnWxzHXFeeWQR0ADIAE= MIME-Version: 1.0 Received: by 10.213.17.208 with SMTP id t16mr2452753eba.19.1284441907154; Mon, 13 Sep 2010 22:25:07 -0700 (PDT) Received: by 10.14.53.80 with HTTP; Mon, 13 Sep 2010 22:25:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 14 Sep 2010 07:25:06 +0200 Message-ID: Subject: Re: Lock example From: Tim Robertson To: zookeeper-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Thanks Mahadev, It's good for this confirmation as this is what I ended up doing. On Mon, Sep 13, 2010 at 11:33 PM, Mahadev Konar wro= te: > Hi Tim, > =A0The lock recipe you mention is supposed to avoid her affect and preven= t starvation (though it has bugs :)). > =A0Are you looking for something like that or just a simple lock and unlo= ck that doesn't have to worry abt the above issues. > If that's the case then just doing an ephemeral create and delete should = give you your lock and unlock recipes. > > > Thanks > mahadev > > > On 9/8/10 9:58 PM, "Tim Robertson" wrote: > > Hi all, > > I am new to ZK and using the queue and lock examples that come with > zookeeper but have run into ZOOKEEPER-645 with the lock. > I have several JVMs each keeping a long running ZK client and the > first JVM (and hence client) does not respect the locks obtained by > subsequent clients - e.g. the first client always manages to get the > lock even if another client holds it. > > Before I start digging, I thought I'd ask if anyone has a simple lock > implemented they might share? =A0My needs are simply to lock a URL to > indicate that it is being worked on, so that I don't hammer my > endpoints with multiple clients. > > Thanks for any advice, > Tim > >