gustavodemorais commented on PR #27935:
URL: https://github.com/apache/flink/pull/27935#issuecomment-4259768916

   One thing worth noting: removing the watermark guard means past-time timers 
registered from onTimer() fire immediately (within the same advanceWatermark 
loop). But it also means something like this lead to infinite loops: 
   
   ```
    public void onTimer(OnTimerContext ctx) {
         // "remind me again in the past" = fires immediately = infinite loop
         ctx.timeContext(Long.class).registerOnTime(0L);
     }
   ```
   
   AI says this is the same behavior as standard Flink KeyedProcessFunction, so 
the design is consistent - just wanted to flag that PTF users were previously 
protected from this and they may shoot themselves in the foot more easily now. 
Maybe worth a short note in the timers section of ptfs.md along the lines of 
"timers registered at or below the current watermark fire immediately at the 
next watermark advance; avoid unconditional re-registration of past-time timers 
from onTimer() as this will cause an infinite loop."


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