-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove timestamp rounding to avoid preliminary timer firing #765
Conversation
@mfateev @samarabbas i suspect these 2 places may be broken due to this change temporal/service/history/timerQueueStandbyTaskExecutor.go Lines 132 to 135 in 50de8a2
temporal/service/history/timerQueueStandbyTaskExecutor.go Lines 190 to 192 in 50de8a2
consider timerTask from above link is generated by timerSequenceID (timestamp being same) |
the comparison within the timerQueueActiveTaskExecutor is not strictly speaking correct.
here the isExpired function is comparing the timerSequence vs "now" say the original timer task before precision loss (before persistence to DB) is T0+0.999ms, the timer task after the precision loss is T0, now is T0+0.5ms, then the timer task which should be fired will not fire. |
to solve this temporal/common/clock/time_source.go Line 60 in 50de8a2
and temporal/common/clock/time_source.go Line 76 in 50de8a2
must be millisecond precision |
Cassandra timer resolution changed from seconds to milliseconds.
After timer resolution changes this rounding caused preliminary timer firing.
I tested it through Java WorkflowTest.timerTest. It was failing frequently without this fix.