The number of timers is about 400 per second. We have observed that onTimer calls are delayed only when the number of scheduled timers starts increasing from a minima. It would be great if you can share pointers to code I can look at to understand it better. :)
Narendra Joshi On 14 Sep 2017 16:04, "Aljoscha Krettek" <aljos...@apache.org> wrote: > Hi, > > Yes, execution of these methods is protected by a synchronized block. This > is not a fair lock so incoming data might starve timer callbacks. What is > the number of timers we are talking about here? > > Best, > Aljoscha > > > On 11. Sep 2017, at 19:38, Chesnay Schepler <c.schep...@web.de> wrote: > > > > It is true that onTimer and processElement are never called at the same > time. > > > > I'm not entirely sure whether there is any prioritization/fairness > between these methods > > (if not if could be that onTimer is starved) , looping in Aljoscha who > hopefully knows more > > about this. > > > > On 10.09.2017 09:31, Narendra Joshi wrote: > >> Hi, > >> > >> We are using Flink as a timer scheduler and delay in timer execution is > >> a huge problem for us. What we have experienced is that as the number of > >> Timers we register increases the timers start getting delayed (for more > >> than 5 seconds). Can anyone point us in the right direction to figure > >> out what might be happening? > >> > >> I have been told that `onTimer` and `processElement` are called with a > >> mutually exclusive lock. Could this locking be the reason this is > >> happening? In both the functions there is no IO happening and it should > >> not take 5 seconds. > >> > >> Is it possible that calls to `processElement` starve `onTimer` calls? > >> > >> > >> -- > >> Narendra Joshi > >> > > > >