temporalio / features

Behavior and history compatibility testing for Temporal SDKs
13 stars 16 forks source link

[Feature Request] Timer duration "jitter" out of box utility #378

Open tsurdilo opened 1 year ago

tsurdilo commented 1 year ago

We often recommend users to add a "jitter" to their timer duration for use cases where thousands of timers across large numbers of workflow executions could potentially fire at the same time.

Users currently have to create their own jitter functions which can often lead to non-deterministic issues. Feature request is to add if possible a utility in SDK when creating timers to be able to specify this "jitter" value as part of these apis and sdk would make sure they are done in a deterministic way.

Quinn-With-Two-Ns commented 9 months ago

Moving out of the Java SDK since it is not Java specific

cretz commented 9 months ago

I think this is more of a sample than an SDK feature. If a user uses non-deterministic rand (whether for jitter or something else) we need to just educate them not to. We provide random for all uses. Also many SDKs don't have a place to set this and note that many language's "sleep" calls expect the user to apply the jitter not the call.