acrites commented on code in PR #40639:
URL: https://github.com/apache/beam/pull/40639#discussion_r4633067556


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java:
##########
@@ -798,19 +802,46 @@ private Windmill.WorkItemCommitRequest.Builder 
buildWorkItemTruncationRequestBui
     return outputBuilder;
   }
 
-  private final long computeSourceBytesProcessed(String 
sourceBytesCounterName) {
+  @VisibleForTesting
+  long computeSourceBytesProcessed(String sourceBytesCounterName) {
     if (!(workExecutor instanceof DataflowMapTaskExecutor)) {
       return 0L;
     }
-    HashMap<String, ElementCounter> counters =
-        ((DataflowMapTaskExecutor) workExecutor)
-            .getReadOperation()
-            .receivers[0]
-            .getOutputCounters();
+    // Note this is a problem for both custom source read operators and SDF 
ParDos: extracting
+    // the byte count counter values here races with 
StreamingWorkerStatusReporter, which also
+    // calls getAndReset on all modified counters to report to Dataflow. We 
should find a more

Review Comment:
   I was trying to keep the PR small(er). I'll send out a separate PR with that 
change (since it also affects custom source) and then we can merge it into this 
PR.



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