arunpandianp commented on code in PR #37574:
URL: https://github.com/apache/beam/pull/37574#discussion_r3150653983


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachineRunner.java:
##########
@@ -187,12 +199,9 @@ private void persistFinishedSet(
     }
 
     ValueState<BitSet> finishedSetState = state.access(FINISHED_BITS_TAG);
-    if (!readFinishedBits(finishedSetState).equals(modifiedFinishedSet)) {
-      if (modifiedFinishedSet.getBitSet().isEmpty()) {
-        finishedSetState.clear();
-      } else {
-        finishedSetState.write(modifiedFinishedSet.getBitSet());
-      }
+    @Nullable BitSet currentBits = finishedSetState.read();
+    if (currentBits == null || 
!currentBits.equals(modifiedFinishedSet.getBitSet())) {
+      finishedSetState.write(modifiedFinishedSet.getBitSet());

Review Comment:
   IIUC, repeated triggers in global windows will cause unbounded state growth. 
It can be avoided by differentiating clear vs delete bitset. Added a TODO, will 
tackle it separately. Since the change is behind an unstable experiment, it is 
safe to merge.



-- 
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