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 3F6311062E for ; Wed, 27 Nov 2013 03:36:11 +0000 (UTC) Received: (qmail 5785 invoked by uid 500); 27 Nov 2013 03:36:10 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 5694 invoked by uid 500); 27 Nov 2013 03:36:08 -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 5676 invoked by uid 99); 27 Nov 2013 03:36:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 03:36:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 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; Wed, 27 Nov 2013 03:36:05 +0000 Received: (qmail 4569 invoked by uid 99); 27 Nov 2013 03:35:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 03:35:38 +0000 Date: Wed, 27 Nov 2013 03:35:38 +0000 (UTC) From: "Orcun Simsek (JIRA)" To: dev@curator.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CURATOR-79) InterProcessMutex doesn't clean up after interrupt 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-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13833414#comment-13833414 ] Orcun Simsek edited comment on CURATOR-79 at 11/27/13 3:34 AM: --------------------------------------------------------------- Also adding a test that fails. {code:title=Test.java|borderStyle=solid} @Test public void testInterruptDeadlock() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString("127.0.0.1:2181") .retryPolicy(new RetryNTimes(10, 1000)) .build(); client.start(); Thread.currentThread().interrupt(); final InterProcessMutex lock = new InterProcessMutex(client, "/testInterruption"); try { lock.acquire(); lock.release(); } catch (InterruptedException e) { if (lock.isAcquiredInThisProcess()) { lock.release(); } } assertTrue(lock.acquire(10, TimeUnit.MILLISECONDS)); } {code} was (Author: ortschun): Also adding a test that fails. {code:title=Test.java|borderStyle=solid} @Test public void testInterruptDeadlock() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString("127.0.0.1:2181") .retryPolicy(new RetryNTimes(10, 1000)) .build(); client.start(); Thread.currentThread().interrupt(); final InterProcessMutex lock = new InterProcessMutex(client, "/testInterruption"); try { lock.acquire(); lock.release(); } catch (InterruptedException e) { e.printStackTrace(); if (lock.isAcquiredInThisProcess()) { lock.release(); } } assertTrue(lock.acquire(10, TimeUnit.MILLISECONDS)); } {code} > InterProcessMutex doesn't clean up after interrupt > -------------------------------------------------- > > Key: CURATOR-79 > URL: https://issues.apache.org/jira/browse/CURATOR-79 > Project: Apache Curator > Issue Type: Bug > Reporter: Orcun Simsek > Assignee: Jordan Zimmerman > Priority: Blocker > > If the current thread is interrupted while acquiring the InterProcessMutex, a new node for the lock is created, InterruptException is thrown, and node is not deleted afterwards. Thus causing a deadlock. > Curator should check the Interrupted state, and do the proper clean up. > This issue was also discussed on: https://groups.google.com/forum/#!topic/curator-users/9ii5of8SbdQ -- This message was sent by Atlassian JIRA (v6.1#6144)