Skip to content

Commit

Permalink
fix(window): accommodate time shift back (#3151)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyong Huang <[email protected]>

(cherry picked from commit 5d16e0e)
Signed-off-by: Jiyong Huang <[email protected]>
  • Loading branch information
ngjaying committed Sep 18, 2024
1 parent 891ce0d commit fe84618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/topo/node/window_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (o *WindowOperator) execProcessingWindow(ctx api.StreamContext, inputs []*x
nextTime += o.duration
log.Debugf("Successive tick at %v(%d), defined at %d", now, now.UnixMilli(), nextTime)
// If the deviation is less than 50ms, then process it. Otherwise, time may change and we'll start a new timer
if now.UnixMilli()-nextTime < 50 {
if math.Abs(float64(now.UnixMilli()-nextTime)) < 50.0 {
inputs = o.tick(ctx, inputs, nextTime, log)
} else {
log.Infof("Skip the tick at %v(%d) since it's too late", now, now.UnixMilli())
Expand Down

0 comments on commit fe84618

Please sign in to comment.