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

ASF GitHub Bot commented on NIFI-1099:
--------------------------------------

Github user olegz commented on the pull request:

    https://github.com/apache/nifi/pull/115#issuecomment-154428329
  
    I just want to make sure that we are all on the same page; _repeat the 
interrupt_ in the context of _Thread.interrupt()_ simply implies communication 
of something that have already happened and is not he same as re-throwing 
exception. Hence my point about that being safe. 
    
    For cases where one really wants to ignore the interrupt especially where 
```Thread.sleep(..)``` is used (a whole other topic), we can simply use 
```LockSupport.parkNanos(..)```.  Any interrupt will not turn into exception 
making user responsible to query the active thread periodically and check if it 
has been interrupted ```Thread.isInterrupted()```.



> Interrupted status is not restored
> ----------------------------------
>
>                 Key: NIFI-1099
>                 URL: https://issues.apache.org/jira/browse/NIFI-1099
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.3.0
>            Reporter: Oleg Zhurakousky
>            Assignee: Oleg Zhurakousky
>             Fix For: 0.4.0
>
>
> There are few places with code that looks like this
> {code}
> try {
>    Thread.sleep(val);
> } catch (InterruptedException ie) {
> }
> {code}
> . . . and the interrupted status of the thread is not restored. Need at the 
> very least 
> {code}
> Thread.currentThread().interrupt();
> {code}



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

Reply via email to