You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Orcun Simsek (JIRA)" <ji...@apache.org> on 2013/11/27 04:33:38 UTC

[jira] [Comment Edited] (CURATOR-79) InterProcessMutex doesn't clean up after interrupt

    [ 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:33 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) {
            e.printStackTrace();
            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}
// Some comments here
public String getFoo()
{
    return foo;
}
{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)