Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2671#discussion_r84464167
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/triggers/ContinuousEventTimeTrigger.java
 ---
    @@ -88,9 +96,13 @@ public TriggerResult onProcessingTime(long time, W 
window, TriggerContext ctx) t
        @Override
        public void clear(W window, TriggerContext ctx) throws Exception {
                ReducingState<Long> fireTimestamp = 
ctx.getPartitionedState(stateDesc);
    -           long timestamp = fireTimestamp.get();
    -           ctx.deleteEventTimeTimer(timestamp);
    -           fireTimestamp.clear();
    +           Long timestamp = fireTimestamp.get();
    +           if (timestamp != null) {
    +                   ctx.deleteEventTimeTimer(timestamp);
    +                   fireTimestamp.clear();
    +           } else if (cachedFireTimestamp != null){
    +                   ctx.deleteEventTimeTimer(cachedFireTimestamp);
    +           }
    --- End diff --
    
    The above `else if` block is not correct because there is only one instance 
of the trigger which is reused for each Window. Hence the abstraction using the 
state descriptor to retrieve the appropriate state.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to