I forgot to say that timers are fault-tolerant. You set them, and Flink takes care of checkpointing and
restoring them after failure. The flag will also be fault-tolerant as, i suppose, you will use Flink’s keyed state.
For more info, you can check the ProcessFunction documentation that Konstantin provided.
There, the example uses a value state to hold the counter, you can do sth similar to keep the flag.
Keep in mind that the state will already be scoped by key so you do not have to worry about that
No problem! Glad I could help!
Re restarting: I missed that ProcessFunction.OnTimerContext extends ProcessFunction.Context! Until now my thought was that OnTimerContext did not provide a means of restarting a timer.
Re initial timer, you're right, I'll just need to track a boolean in a state variable that notes whether or not the timer has been initialized. What I am not confident about is how to manage timer recovery after a node failure; I imagine it will make sense to not track this variable. I will do more research and cross that bridge when I get there.
So I think a process function will work just fine, here. Thank you again for your time, Kostas and Konstantin.