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


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -1873,14 +1915,20 @@ private void sendWorkerUpdatesToDataflowService(
    */
   private void refreshActiveWork() {
     Map<String, List<Windmill.KeyedGetDataRequest>> active = new HashMap<>();
+    Map<String, List<Windmill.HeartbeatRequest>> heartbeats = new HashMap<>();
     Instant refreshDeadline =
         
clock.get().minus(Duration.millis(options.getActiveWorkRefreshPeriodMillis()));
 
     for (Map.Entry<String, ComputationState> entry : 
computationMap.entrySet()) {
-      active.put(entry.getKey(), 
entry.getValue().getKeysToRefresh(refreshDeadline, sampler));
+      if (windmillServiceEnabled
+          && DataflowRunner.hasExperiment(options, 
"send_new_heartbeat_requests")) {
+        heartbeats.put(entry.getKey(), 
entry.getValue().getKeyHeartbeats(refreshDeadline, sampler));
+      } else {
+        active.put(entry.getKey(), 
entry.getValue().getKeysToRefresh(refreshDeadline, sampler));

Review Comment:
   It's adding a bit more to the implementation, but I've changed the worker to 
not add the user key to the heartbeats. Note I needed to change windmill.proto 
to have the user key be optional instead of required, but I think this should 
be compatible since Windmill is ignoring the field anyway (and the internal 
version of the proto already seems to have it as optional as well).



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