boyuanzz commented on a change in pull request #13105:
URL: https://github.com/apache/beam/pull/13105#discussion_r517607818



##########
File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/ExecutableStageDoFnOperator.java
##########
@@ -502,6 +690,8 @@ public void close() throws Exception {
     processWatermark1(Watermark.MAX_WATERMARK);
     while (getCurrentOutputWatermark() < 
Watermark.MAX_WATERMARK.getTimestamp()) {
       invokeFinishBundle();
+      // Sleep for 5s to wait for any timer to be fired.
+      Thread.sleep(5000);

Review comment:
       >  Is there a way to only sleep if there are such pending timers and 
then wait for precisely as long as the maximum of such timers?
   One way I'm coming up with is we only sleep when we are executing 
SDF/Process fn.
   
   > Also, I'm surprised these timers get fired at all, since newer versions of 
Flink stop processing timer execution once closing the operator (that's why we 
are draining the timers manually in super.close()).
   I haven't looked into Flink timer service yet but I guess it might be 
related to watermark hold.




----------------------------------------------------------------
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:
[email protected]


Reply via email to