소스 검색

HADOOP-19452. Client#call decrease asyncCallCounter incorrectlly when exceptions occur. (#7384). Contributed by hfutatzhanghb.

Reviewed-by: Jian Zhang <keepromise@apache.org>
hfutatzhanghb 3 달 전
부모
커밋
b73796a43c
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

+ 1 - 2
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

@@ -1462,7 +1462,6 @@ public class Client implements AutoCloseable {
   private void checkAsyncCall() throws IOException {
     if (isAsynchronousMode()) {
       if (asyncCallCounter.incrementAndGet() > maxAsyncCalls) {
-        asyncCallCounter.decrementAndGet();
         String errMsg = String.format(
             "Exceeded limit of max asynchronous calls: %d, " +
             "please configure %s to adjust it.",
@@ -1518,7 +1517,7 @@ public class Client implements AutoCloseable {
         ioe.initCause(ie);
         throw ioe;
       }
-    } catch(Exception e) {
+    } catch (Exception e) {
       if (isAsynchronousMode()) {
         releaseAsyncCall();
       }