You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Aljoscha Krettek (JIRA)" <ji...@apache.org> on 2018/07/16 09:35:00 UTC

[jira] [Created] (FLINK-9857) Processing-time timers fire too early

Aljoscha Krettek created FLINK-9857:
---------------------------------------

             Summary: Processing-time timers fire too early
                 Key: FLINK-9857
                 URL: https://issues.apache.org/jira/browse/FLINK-9857
             Project: Flink
          Issue Type: Bug
          Components: DataStream API
    Affects Versions: 1.5.1, 1.4.2, 1.3.4, 1.6.0
            Reporter: Aljoscha Krettek
             Fix For: 1.5.2, 1.6.0


The firing of processing-time timers is off by one. This leads to problems in edge cases, as discovered [here (mailing list)|https://lists.apache.org/thread.html/e49748fa5fa1c9217b9dfb65eea7a37af1f2895c769528e77a1a93fa@%3Cuser.flink.apache.org%3E] when elements arrive at the timestamp that is the end of the window.

The problem is [here (github)|https://github.com/apache/flink/blob/79b38f8f9a79b917d525842cf46087c5b8c40f3d/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/HeapInternalTimerService.java#L231]. For event-time, we fire timers when the watermark is >= the timestamp, this is correct because a watermark T says that we will not see elements with a timestamp smaller or equal to T. For processing time, a time of T does not say that we won't see an element with timestamp T, which makes processing-time timers fire one ms too early.

I think we can fix it by turning that {{<=}} into a {{<}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)