Browse Source

HADOOP-5417. Don't ignore InterruptedExceptions that happen when calling
into rpc. (omalley)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@756356 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 16 years ago
parent
commit
7c513ec331
2 changed files with 15 additions and 3 deletions
  1. 5 2
      CHANGES.txt
  2. 10 1
      src/core/org/apache/hadoop/ipc/Client.java

+ 5 - 2
CHANGES.txt

@@ -773,8 +773,11 @@ Release 0.20.0 - Unreleased
     HADOOP-5534. Fixed a deadlock in Fair scheduler's servlet.
     (Rahul Kumar Singh via yhemanth)
 
-    HADOOP-5328. Fixes a problem in the renaming of job history files during job
-    recovery. Amar Kamat via ddas)
+    HADOOP-5328. Fixes a problem in the renaming of job history files during 
+    job recovery. Amar Kamat via ddas)
+
+    HADOOP-5417. Don't ignore InterruptedExceptions that happen when calling 
+    into rpc. (omalley)
 
 Release 0.19.2 - Unreleased
 

+ 10 - 1
src/core/org/apache/hadoop/ipc/Client.java

@@ -718,11 +718,20 @@ public class Client {
     Call call = new Call(param);
     Connection connection = getConnection(addr, protocol, ticket, call);
     connection.sendParam(call);                 // send the parameter
+    boolean interrupted = false;
     synchronized (call) {
       while (!call.done) {
         try {
           call.wait();                           // wait for the result
-        } catch (InterruptedException ignored) {}
+        } catch (InterruptedException ie) {
+          // save the fact that we were interrupted
+          interrupted = true;
+        }
+      }
+
+      if (interrupted) {
+        // set the interrupt flag now that we are done waiting
+        Thread.currentThread().interrupt();
       }
 
       if (call.error != null) {