Skip to content

Commit ef73156

Browse files
committed
HADOOP-10630. Possible race condition in RetryInvocationHandler. Contributed by Jing Zhao.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1599366 13f79535-47bb-0310-9956-ffa450edef68
1 parent 47adf94 commit ef73156

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ Release 2.5.0 - UNRELEASED
527527
HADOOP-10638. Updating hadoop-daemon.sh to work as expected when nfs is
528528
started as a privileged user. (Manikandan Narayanaswamy via atm)
529529

530+
HADOOP-10630. Possible race condition in RetryInvocationHandler. (jing9)
531+
530532
Release 2.4.1 - UNRELEASED
531533

532534
INCOMPATIBLE CHANGES

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.apache.hadoop.ipc.RPC;
3737
import org.apache.hadoop.ipc.RpcConstants;
3838
import org.apache.hadoop.ipc.RpcInvocationHandler;
39-
import org.apache.hadoop.util.ThreadUtil;
4039

4140
import com.google.common.annotations.VisibleForTesting;
4241

@@ -160,11 +159,11 @@ public Object invoke(Object proxy, Method method, Object[] args)
160159
if (invocationAttemptFailoverCount == proxyProviderFailoverCount) {
161160
proxyProvider.performFailover(currentProxy.proxy);
162161
proxyProviderFailoverCount++;
163-
currentProxy = proxyProvider.getProxy();
164162
} else {
165163
LOG.warn("A failover has occurred since the start of this method"
166164
+ " invocation attempt.");
167165
}
166+
currentProxy = proxyProvider.getProxy();
168167
}
169168
invocationFailoverCount++;
170169
}

0 commit comments

Comments
 (0)