Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.11.4, 1.14.0, 1.12.5, 1.13.2
-
None
-
None
Description
After FLINK-23208, the processing timers are triggered more efficiently but it can still be improved. (The performance can be tested with benchmark)
Currently InternalTimerService.onProcessingTime(long) polls a timer from processingTimeTimersQueue and register a new timer after the polled timer is triggered, which means timers with different timestamps will be registered for multiple times. This can be improved with codes below:
long now = System.currentTimeMillis() - 1 while ((timer = processingTimeTimersQueue.peek()) != null && timer.getTimestamp() <= now) { processingTimeTimersQueue.poll(); keyContext.setCurrentKey(timer.getKey()); triggerTarget.onProcessingTime(timer); }
But due to the bug described in FLINK-23689, this change has conflicts with current implementation of TestProcessingTimeService.setCurrentTime(long), which causes a lot of tests to fail(e.g. InternalTimerServiceImplTest). Therefore, before working on this improvement, FLINK-23689 should be fixed firstly.
Attachments
Issue Links
- is blocked by
-
FLINK-23689 TestProcessingTimeService.setCurrentTime(long) not delay the firing timer by 1ms delay
- Open
- relates to
-
FLINK-23208 Late processing timers need to wait 1ms at least to be fired
- Closed