curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-208) InterProcessSemaphoreV2 swallows InterruptedException
Date Wed, 13 Jan 2016 20:23:39 GMT

    [ https://issues.apache.org/jira/browse/CURATOR-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096922#comment-15096922
] 

ASF GitHub Bot commented on CURATOR-208:
----------------------------------------

GitHub user Randgalt opened a pull request:

    https://github.com/apache/curator/pull/125

    [CURATOR-208] General fix for catch-alls throughout the code and interruptes

    General fix for catch-alls throughout the code. This is overkill but it strikes me as
the safest way to address the problem. Everywhere there is a catch-all add a check for InterruptedException
and reset the thread's interrupted state

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-208

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/125.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #125
    
----
commit 003acc6027aa63e59b5de3b0d1da7e33c2b9f9cc
Author: randgalt <randgalt@apache.org>
Date:   2016-01-13T20:20:54Z

    General fix for catch-alls throughout the code. This is overkill but it strikes me as
the safest way to address the problem. Everywhere there is a catch-all add a check for InterruptedException
and reset the thread's interrupted state

----


> InterProcessSemaphoreV2 swallows InterruptedException
> -----------------------------------------------------
>
>                 Key: CURATOR-208
>                 URL: https://issues.apache.org/jira/browse/CURATOR-208
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.6.0, 2.7.1
>            Reporter: Alexei Osipov
>            Priority: Minor
>              Labels: easyfix
>
> {{InterProcessSemaphoreV2}} incorrectly processes {{InterruptedException}}.
> Method `InterProcessSemaphoreV2#makeLease(final String path)` contains code block
> {code}
>                 try
>                 {
>                     client.delete().guaranteed().forPath(path);
>                 }
>                 catch ( KeeperException.NoNodeException e )
>                 {
>                     log.warn("Lease already released", e);
>                 }
>                 catch ( Exception e )
>                 {
>                     throw new IOException(e);
>                 }
> {code}
> The problem is that code in {{try}} block may throw an {{InterruptedException}} and this
exception gets wrapped into {{IOException}} so it becomes very problematic to handle it properly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message