You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Raghu Angadi (JIRA)" <ji...@apache.org> on 2008/03/13 01:13:46 UTC

[jira] Created: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

SocketIOWithTimeout does not handle thread interruption
-------------------------------------------------------

                 Key: HADOOP-3008
                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
             Project: Hadoop Core
          Issue Type: Bug
    Affects Versions: 0.17.0
            Reporter: Raghu Angadi
             Fix For: 0.17.0



If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.

In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I just committed this.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Attachment: HADOOP-3008.patch

Attached patch throws InterruptedIOException. TestSocketIOWithTimeout tests this bug.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579893#action_12579893 ] 

Hudson commented on HADOOP-3008:
--------------------------------

Integrated in Hadoop-trunk #432 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/432/])

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578418#action_12578418 ] 

dhruba borthakur commented on HADOOP-3008:
------------------------------------------

+1 The code in SocketIOWithTimeout.java looks good.

I am a little worried about the test case though. because of the fixed timeout values in the test, it might fail on some platforms. Maybe we can make the read wait infinitely without a timeout and then send an interrupt to it and then verify that it exited. This might eliminate having fixed timeouts.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Status: Patch Available  (was: Open)

The latest patch does not have a timeout for interrupt test.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi reassigned HADOOP-3008:
------------------------------------

    Assignee: Raghu Angadi

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

     Description: 
If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.

In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

  was:

If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.

In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

    Release Note: User Impact : none. SocketIOWithTimeout does not handle thread interruption

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Attachment: HADOOP-3008.patch

Attached stale patch last time.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Attachment: HADOOP-3008.patch

Removed extra import added in earlier patch.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Release Note:   (was: User Impact : none. SocketIOWithTimeout does not handle thread interruption)

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579007#action_12579007 ] 

Hadoop QA commented on HADOOP-3008:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
http://issues.apache.org/jira/secure/attachment/12377840/HADOOP-3008.patch
against trunk revision 619744.

    @author +1.  The patch does not contain any @author tags.

    tests included +1.  The patch appears to include 3 new or modified tests.

    javadoc +1.  The javadoc tool did not generate any warning messages.

    javac +1.  The applied patch does not generate any new javac compiler warnings.

    release audit +1.  The applied patch does not generate any new release audit warnings.

    findbugs +1.  The patch does not introduce any new Findbugs warnings.

    core tests +1.  The patch passed core unit tests.

    contrib tests +1.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1967/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1967/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1967/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1967/console

This message is automatically generated.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3008) SocketIOWithTimeout does not handle thread interruption

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raghu Angadi updated HADOOP-3008:
---------------------------------

    Attachment: HADOOP-3008.patch

Thanks Dhruba.

The test required that thread return in 6 seconds after being interrupted. The latest patch removes that.

> SocketIOWithTimeout does not handle thread interruption
> -------------------------------------------------------
>
>                 Key: HADOOP-3008
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3008
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.17.0
>            Reporter: Raghu Angadi
>            Assignee: Raghu Angadi
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3008.patch, HADOOP-3008.patch, HADOOP-3008.patch
>
>
> If a thread is waiting in {{SocketIOWithTimeout.select()}} for IO and is interrupted by another thread, select() returns zero. But current implementation does not check if the thread is interrupted and goes back to waiting. But it should check if the thread is interrupted.
> In this case, I am thinking of throwing {{InterruptedIOException}} http://java.sun.com/j2se/1.5.0/docs/api/java/io/InterruptedIOException.html.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.