SteNicholas commented on code in PR #2134:
URL: 
https://github.com/apache/incubator-celeborn/pull/2134#discussion_r1419796383


##########
common/src/main/java/org/apache/celeborn/common/write/InFlightRequestTracker.java:
##########
@@ -58,11 +55,10 @@ public InFlightRequestTracker(CelebornConf conf, PushState 
pushState) {
   }
 
   public void addBatch(int batchId, String hostAndPushPort) {
-    Set<Integer> batchIdSetPerPair =
+    Set<Integer> batchIdSet =
         inflightBatchesPerAddress.computeIfAbsent(
             hostAndPushPort, id -> ConcurrentHashMap.newKeySet());
-    batchIdSetPerPair.add(batchId);
-    totalInflightReqs.increment();
+    batchIdSet.add(batchId);
   }
 
   public void removeBatch(int batchId, String hostAndPushPort) {

Review Comment:
   @FMX, Is it guaranteed that when addBatch is called once, removeBatch will 
only be called once? IMO, it could not be guaranteed when the `batchId` is 
removed from `batchIdSet` and the `totalInflightReqs` could also decrement.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to