You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/01/05 14:14:58 UTC

[jira] [Commented] (CURATOR-375) FIx thread interruption being reported twice

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

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

GitHub user thecoop opened a pull request:

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

    [CURATOR-375] - fix thread interruption being reported twice

    In some classes, thread interruption was being reported twice - by setting the thread interrupted flag and re-throwing the `InterruptedException` - this made it look like the thread was actually interrupted twice, and generally causes spurious interruption - even if the `InterruptedException` is handled, the thread interruption status is still set, meaning the next async operation that happens will also fail.
    
    Affected classes:
    - `ConnectionState` - `closeAndClear` can never throw `InterruptedException` canyway, so remove the check completely
    - `PersistentNode` - as mentioned in the docs for `AutoCloseable`, close methods shouldn't throw InterruptedException anyway. The delete operation is guaranteed, so even if `deleteNode` throws an exception, the node will still (probably) be deleted
    - `CreateBuilderImpl`/`DeleteBuilderImpl` - the exception is being re-thrown, so don't need to re-set the interrupt status

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

    $ git pull https://github.com/thecoop/curator CURATOR-375

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

    https://github.com/apache/curator/pull/186.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 #186
    
----
commit 81edd7e07a1fae2412c3e42e74a31b992aa72669
Author: Simon Cooper <si...@featurespace.co.uk>
Date:   2017-01-05T14:08:17Z

    CURATOR-375 - fix thread interruption being reported using thread interrupted flag and an exception at the same time

----


> FIx thread interruption being reported twice
> --------------------------------------------
>
>                 Key: CURATOR-375
>                 URL: https://issues.apache.org/jira/browse/CURATOR-375
>             Project: Apache Curator
>          Issue Type: Bug
>    Affects Versions: 2.11.1
>            Reporter: Simon Cooper
>            Assignee: Jordan Zimmerman
>
> When a curator operation thread is interrupted, some classes ({{PersistentNode}} {{ConnectionState}} primarily) report the interruption in two ways at the same time - by re-marking the thread interruption status *and* throwing {{InterruptedException}} - this makes it look like the thread has been interrupted twice, rather than once.



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