hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HADOOP-12464. Interrupted client may try to fail-over and retry. Contributed by Kihwal Lee. (cherry picked from commit 6144e0137bb51bd04b46ea5ce42c59c2d4f7657d)
Date Mon, 19 Oct 2015 15:56:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 e4429de86 -> e86819c91


HADOOP-12464. Interrupted client may try to fail-over and retry. Contributed by Kihwal Lee.
(cherry picked from commit 6144e0137bb51bd04b46ea5ce42c59c2d4f7657d)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e86819c9
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e86819c9
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e86819c9

Branch: refs/heads/branch-2
Commit: e86819c91f405e0cde379c8add3917680c534d13
Parents: e4429de
Author: Kihwal Lee <kihwal@apache.org>
Authored: Mon Oct 19 10:56:19 2015 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Mon Oct 19 10:56:19 2015 -0500

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt           |  2 ++
 .../apache/hadoop/io/retry/RetryInvocationHandler.java    |  4 ++++
 .../src/main/java/org/apache/hadoop/ipc/Client.java       | 10 ++--------
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e86819c9/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index a61e3cd..d5c2a5e 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -785,6 +785,8 @@ Release 2.7.2 - UNRELEASED
     HADOOP-12465. Incorrect javadoc in WritableUtils.java.
     (Jagadesh Kiran N via aajisaka)
 
+    HADOOP-12464. Interrupted client may try to fail-over and retry (kihwal)
+
 Release 2.7.1 - 2015-07-06 
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e86819c9/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
index c31d28e..5d94c3b 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
@@ -105,6 +105,10 @@ public class RetryInvocationHandler<T> implements RpcInvocationHandler
{
         hasMadeASuccessfulCall = true;
         return ret;
       } catch (Exception ex) {
+        if (Thread.currentThread().isInterrupted()) {
+          // If interrupted, do not retry.
+          throw ex;
+        }
         boolean isIdempotentOrAtMostOnce = proxyProvider.getInterface()
             .getMethod(method.getName(), method.getParameterTypes())
             .isAnnotationPresent(Idempotent.class);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e86819c9/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
index 19a68d7..9c70382 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
@@ -1428,22 +1428,16 @@ public class Client {
       throw new IOException(e);
     }
 
-    boolean interrupted = false;
     synchronized (call) {
       while (!call.done) {
         try {
           call.wait();                           // wait for the result
         } catch (InterruptedException ie) {
-          // save the fact that we were interrupted
-          interrupted = true;
+          Thread.currentThread().interrupt();
+          throw new InterruptedIOException("Call interrupted");
         }
       }
 
-      if (interrupted) {
-        // set the interrupt flag now that we are done waiting
-        Thread.currentThread().interrupt();
-      }
-
       if (call.error != null) {
         if (call.error instanceof RemoteException) {
           call.error.fillInStackTrace();


Mime
View raw message