arunpandianp commented on code in PR #41444:
URL: https://github.com/apache/beam/pull/41444#discussion_r4636009523


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcDirectGetWorkStream.java:
##########
@@ -244,8 +256,11 @@ protected synchronized void onFlushPending(boolean 
isNewStream)
     if (!isNewStream) {
       return;
     }
-    budgetTracker.reset();
-    GetWorkBudget initialGetWorkBudget = 
budgetTracker.computeBudgetExtension();
+    // Reset and record initial budget before sending the header so concurrent 
updates observe it.
+    BudgetExtension initialExtension = 
budgetTracker.resetAndRecordInitialBudget();
+    ((DirectGetWorkPhysicalStreamHandler) 
checkNotNull(currentPhysicalStream)).streamEpoch =

Review Comment:
   instead of storing streamEpoch, thoughts on storing currentPhysicalStream 
inside budgetTracker and checking (budgetTracker.targetStream == 
currentPhysicalStream) before `trySend` in `maybeSendRequestExtension`?



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