scwhittle commented on code in PR #29979:
URL: https://github.com/apache/beam/pull/29979#discussion_r1457952149
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowExecutionStateSampler.java:
##########
@@ -117,7 +117,8 @@ public Optional<ActiveMessageMetadata>
getActiveMessageMetadataForWorkId(String
return Optional.ofNullable(null);
}
- public Map<String, IntSummaryStatistics>
getProcessingDistributionsForWorkId(String workId) {
+ public synchronized Map<String, IntSummaryStatistics>
getProcessingDistributionsForWorkId(
Review Comment:
since removeTracker isn't synchronized it still seems like the race is
possible.
An alternative since the activeTrackersByWorkId is a concurrent map would be
to just call get() first and replace the containsKey check with comparing if
null is returned.
similarly the completedProcessingMetrics.containsKey check could be replaced
by using getOrDefault
--
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]