Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-23690

Processing timers can be triggered more efficiently

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.4, 1.14.0, 1.12.5, 1.13.2
    • None
    • Runtime / Task
    • 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

          Activity

            People

              Unassigned Unassigned
              wind_ljy Jiayi Liao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: