ahmedabu98 commented on code in PR #40975:
URL: https://github.com/apache/beam/pull/40975#discussion_r4473340982
##########
sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go:
##########
@@ -1621,13 +1621,19 @@ func (*statefulStageKind) addPending(ss *stageState, em
*ElementManager, newPend
timers: map[timerKey]timerTimes{},
}
ss.pendingByKeys[string(e.keyBytes)] = dnt
- if ss.keysToExpireByWindow != nil {
- w, ok := ss.keysToExpireByWindow[e.window]
- if !ok {
- w = make(set[string])
- ss.keysToExpireByWindow[e.window] = w
- }
+ }
+ // The key owes an OnWindowExpiration callback for each window
it uses. The callback counts
+ // as pending until its bundle persists, so the job can't end
before the callback runs.
+ // A cleared timer, with a sequence of -1, doesn't use its
window.
+ if ss.keysToExpireByWindow != nil && e.sequence >= 0 {
+ w, ok := ss.keysToExpireByWindow[e.window]
+ if !ok {
+ w = make(set[string])
+ ss.keysToExpireByWindow[e.window] = w
+ }
+ if !w.present(string(e.keyBytes)) {
w.insert(string(e.keyBytes))
+ count++
Review Comment:
Split it into two different counters for readability
--
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]