reuvenlax commented on a change in pull request #11924:
URL: https://github.com/apache/beam/pull/11924#discussion_r436147265



##########
File path: 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingModeExecutionContext.java
##########
@@ -577,12 +583,21 @@ public void flushState() {
                         WindmillTimerInternals.windmillTimerToTimerData(
                             WindmillNamespacePrefix.USER_NAMESPACE_PREFIX, 
timer, windowCoder))
                 .iterator();
+
+        cachedFiredUserTimers.forEachRemaining(toBeFiredTimersOrdered::add);
+      }
+
+      Instant currentInputWatermark = 
userTimerInternals.currentInputWatermarkTime();
+      if (userTimerInternals.hasTimerBefore(currentInputWatermark)) {
+        while (!toBeFiredTimersOrdered.isEmpty()) {
+          userTimerInternals.setTimer(toBeFiredTimersOrdered.poll());
+        }
       }

Review comment:
       @kennknowles for comment. This doesn't look right to me, as I don't 
think we should be modifying the WindmillTimerInternals here. I think we just 
want to merge the timer modifications from processing the workitem into this 
priority queue; note that if timers are deleted, we need to detect that as well 
and remove from the priority queue.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to