homatthew commented on code in PR #3586:
URL: https://github.com/apache/gobblin/pull/3586#discussion_r1001083931


##########
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnService.java:
##########
@@ -845,8 +877,6 @@ public void onContainersAllocated(List<Container> 
containers) {
               instanceName = null;
             }
           }
-          allocatedContainerCountMap.put(containerHelixTag,

Review Comment:
   Another approach is to just add synchronization in `onContainersCompleted`. 
It doesn't make sense to me that handleCompletion method has no concurrency 
safe guards and can freely modify the inUsedInstances set while this method is 
iterating over the set. 
   
   I am hesitant to change too much here because "it works". But at the same 
time I'd love to make the usage of concurrency primitives consistent so it's 
not so confusing. 🤷 
   
   Even in the original PR there is a question about usage of explicit lock vs 
intrinsic lock https://github.com/apache/gobblin/pull/3059



-- 
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