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 E7DFD9DC8 for ; Tue, 28 May 2013 12:52:53 +0000 (UTC) Received: (qmail 15860 invoked by uid 500); 28 May 2013 12:52:53 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 15826 invoked by uid 500); 28 May 2013 12:52:53 -0000 Mailing-List: contact dev-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.incubator.apache.org Delivered-To: mailing list dev@curator.incubator.apache.org Received: (qmail 15617 invoked by uid 99); 28 May 2013 12:52:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 12:52:44 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 28 May 2013 12:52:42 +0000 Received: (qmail 15055 invoked by uid 99); 28 May 2013 12:52:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 12:52:20 +0000 Date: Tue, 28 May 2013 12:52:20 +0000 (UTC) From: "3l3ph4n1n3 (JIRA)" To: dev@curator.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-28) Add Expiry Time To InterProcessLocks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CURATOR-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13668284#comment-13668284 ] 3l3ph4n1n3 commented on CURATOR-28: ----------------------------------- Do you mean a thread on the client with the lock, all clients or on the Zookeeper node? All clients should agree that the lock is unlocked after the timeout, even if the client who took it misbehaves (e.g. doesn't explicitly release the lock itself)... > Add Expiry Time To InterProcessLocks > ------------------------------------ > > Key: CURATOR-28 > URL: https://issues.apache.org/jira/browse/CURATOR-28 > Project: Apache Curator > Issue Type: New Feature > Components: Recipes > Affects Versions: 2.0.0-incubating > Reporter: 3l3ph4n1n3 > Assignee: Jordan Zimmerman > Priority: Minor > > If a client takes a distributed lock and fails without breaking its zookeeper connection (e.g. the main application thread deadlocks) then that lock will never be released (at least without manual intervention, e.g. killing the process that has it). When a client's acquiring a lock I'd like to be able to specify a time after which the lock is automatically released. If the client currently holds the lock it should be able to extend this time period as many times as it likes. A write-up for what I'm describing for redis is here: https://chris-lamb.co.uk/posts/distributing-locking-python-and-redis . > I can see a couple of ways of going about this - the lock lifetime could be stored in the node's date (and so clients could check if the node had expired by adding the lifetime to the node's ctime or mtime). However, comparing the client's current time with the expiry time in the node is probably not the right thing to do as the client's clock may be out of sync with the other clients (or the zookeeper nodes). It'd be nice if zookeeper could automatically delete nodes (i.e. release the lock) after a certain amount of time - i.e. make it the zookeeper cluster's decision when the lock is expired, not the client's decision. However, I'm not sure exactly how to do this... > Thanks, -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira