scwhittle commented on a change in pull request #13861:
URL: https://github.com/apache/beam/pull/13861#discussion_r571973308



##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/ExecutionStateSampler.java
##########
@@ -151,8 +150,10 @@ void addTracker(ExecutionStateTracker tracker) {
    *
    * <p>This method needs to be synchronized to prevent race condition with 
sampling thread
    */
-  synchronized void removeTracker(ExecutionStateTracker tracker) {
-    this.activeTrackers.remove(tracker);
+  void removeTracker(ExecutionStateTracker tracker) {
+    synchronized (this) {

Review comment:
       moved comment to member variable since that seemed more appropriate.




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

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


Reply via email to