[
https://issues.apache.org/jira/browse/FLINK-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14556102#comment-14556102
]
Gabor Gevay commented on FLINK-2074:
------------------------------------
I did some debugging on this, and although I don't understand a lots of things
in the relevant code, I think I found one problem:
In SlidingTimePreReducer, when an element is given to
timestampWrapper.getTimestamp, it is not returning the same timestamp that is
used in TimeEvictionPolicy and TimeTriggerPolicy to determine the windows,
because it ultimately calls SystemTimestamp.getTimestamp, which just returns
System.currentTimeMillis().
This might cause a bug in SlidingTimePreReducer.currentEligible, because that
function determines when to close a preaggregate and start a new one, and so an
element can get into the preaggregate of a later window than what the policy is
saying (if it is before the end of a window by just a few milliseconds, and
this call happens a few milliseconds later then the getTimestamp call in the
policies).
Another place where this can cause trouble is SlidingTimePreReducer.afterEmit.
I really have no idea how the condition of the inner if can ever be false, but
it is most likely not checking what it was intended to check, as
timestampWrapper.getTimestamp(lastStored) won't return the timestamp of the
last stored element, but will return the current system time instead.
Unfortunately this is not causing the bug that this Jira is describing, as this
can occur only rarely, but the Jira is easy to reproduce.
> Sliding Window Keeps Emitting Elements After Source Stops Producing
> -------------------------------------------------------------------
>
> Key: FLINK-2074
> URL: https://issues.apache.org/jira/browse/FLINK-2074
> Project: Flink
> Issue Type: Bug
> Components: Streaming
> Affects Versions: 0.9
> Reporter: Aljoscha Krettek
> Priority: Blocker
>
> This happens when the source produces some elements, then the source stops
> for a while and then produces again some elements before stopping again.
> After this, the window will just keep emitting the last emitted element
> indefinitely.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)