MartijnVisser commented on code in PR #28822:
URL: https://github.com/apache/flink/pull/28822#discussion_r4713927359


##########
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java:
##########
@@ -369,6 +369,11 @@ public void onProcessingTime(InternalTimer<KEY, 
VoidNamespace> timer) throws Exc
 
         // STEP 4
         updateNFA(nfa);
+
+        // In order to remove dangling partial matches.
+        if (nfa.getPartialMatches().size() == 1 && 
nfa.getCompletedMatches().isEmpty()) {
+            computationStates.clear();

Review Comment:
   It would also save state writes: an expiry now updates the NFA state and 
clears it right after, and with a comparator a timer on a key without state 
still clears.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to