[JBoss JIRA] Commented: (NETTY-217) If catching InterruptedException, set back interrupt status of the thread

Trustin Lee (JIRA) jira-events at lists.jboss.org
Fri Sep 4 00:28:23 EDT 2009


    [ https://jira.jboss.org/jira/browse/NETTY-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12484511#action_12484511 ] 

Trustin Lee commented on NETTY-217:
-----------------------------------

Just as a side note, the await() and awaitUninterruptibly() method in AbstractQueuedSynchronizer.ConditionObject were helpful to me in fixing this issue.

> If catching InterruptedException, set back interrupt status of the thread
> -------------------------------------------------------------------------
>
>                 Key: NETTY-217
>                 URL: https://jira.jboss.org/jira/browse/NETTY-217
>             Project: Netty
>          Issue Type: Bug
>            Reporter: Elias Ross
>            Assignee: Trustin Lee
>             Fix For: 3.1.3.GA
>
>
> Netty contains a lot of this construct:
>             try {
>                 future = futureQueue.poll(Integer.MAX_VALUE, TimeUnit.SECONDS);
>             } catch (InterruptedException e) {
>                 // Ignore
>             }
> If interrupt occurs, reset the interrupted status and it's suggested you throw an exception as appropriate, e.g. java.io.InterruptedIOException.
> See this: http://www.ibm.com/developerworks/java/library/j-jtp05236.html 
> The following pattern should be used, generally:
> try {
> // stuff here
> } catch (InterruptedException e) {
>   Thread.currentThread().interrupt();
> }
> DefaultChannelFuture and its kind need to be fixed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the netty-dev mailing list