temporalio / sdk-core

Core Temporal SDK that can be used as a base for language specific Temporal SDKs
MIT License
266 stars 70 forks source link

Job ordering updates #789

Closed Sushisource closed 3 weeks ago

Sushisource commented 1 month ago

What was changed

Make UpdateRandomSeed jobs come after start workflow, but before everything else.

Why?

These could technically have consequences for later actions, and should go first. It's intuitive.

The more delicate change here is actually sorting StartWorkflow before other stuff, which also seems intuitive, but a number of tests at least in core had some expectations around updates being able to come first. Frankly, that doesn't make a ton of sense, and I don't really expect this move to be any kind of real issue, but it might require some changes to langs that are using StartWorkflow as a synonym for "do first iteration of the event loop"? If such changes are needed, they should be the ones described here: https://github.com/temporalio/sdk-python/issues/606 (.NET may need an equivalent item) as none of these problems exist if all jobs are all read and applied to state first, before doing any iterating of the event loop.

Checklist

  1. Closes https://github.com/temporalio/sdk-core/issues/790

  2. How was this tested: Updated existing tests

  3. Any docs updates needed?