You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Gopal V (JIRA)" <ji...@apache.org> on 2013/05/31 18:14:20 UTC

[jira] [Updated] (HADOOP-9612) HADOOP client IPC layer should differentiate between interrupted threads and interrupts occurring during operations

     [ https://issues.apache.org/jira/browse/HADOOP-9612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gopal V updated HADOOP-9612:
----------------------------

    Attachment: hdfs-interruptus.tgz

Small test case to interrupt a thread, catch the Exception and perform an HDFS file open.

$ hadoop jar target/*.jar -i <hdfs-file>
                
> HADOOP client IPC layer should differentiate between interrupted threads and interrupts occurring during operations
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-9612
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9612
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.0.5-beta
>         Environment: Ubuntu / x86_64
>            Reporter: Gopal V
>            Assignee: Gopal V
>            Priority: Trivial
>         Attachments: hdfs-interruptus.tgz
>
>
> Hadoop IPC throws misleading wrapped exceptions when operations are performed on threads which have already been interrupted.
> When a thread is already interrupted, the client IPC throws the following exception
> {code}
> Exception in thread "main" java.io.IOException:
> ...
>         at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:761)
> 	at org.apache.hadoop.ipc.Client.call(Client.java:1270)
> 	at org.apache.hadoop.ipc.Client.call(Client.java:1218)
> 	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:202)
> 	at $Proxy9.getBlockLocations(Unknown Source)
> {code}
> This is completely indistinguishable between a real interruption happening to the thread during the client call and very misleading.
> Before client calls, it would be prudent to check for the currentThread().isInterrupted() flag and throw a different exception to indicate the thread was already interrupted before the operation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira