Browse Source

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

Reviewed-by: Jian Zhang <keepromise@apache.org>
hfutatzhanghb 3 months ago
parent
commit
b73796a43c

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