Conversation
- Update entity messages to use UUIDs as requestIds
There was a problem hiding this comment.
Pull request overview
This PR adds a new_uuid() method to the OrchestrationContext to generate replay-safe UUIDs, which is required for Azure Functions compatibility where the entity protocol needs request IDs to be parseable as GUIDs in .NET.
Key changes:
- Implements
new_uuid()method using RFC 4122 §4.3 name-based UUID generation with orchestration instance ID, current UTC datetime, and an internal counter - Updates entity message functions to use generated UUIDs instead of simple string concatenations for request IDs
- Adds comprehensive end-to-end tests validating UUID uniqueness across replays
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| durabletask/task.py | Adds abstract new_uuid() method definition with documentation to OrchestrationContext |
| durabletask/worker.py | Implements new_uuid() method in _RuntimeOrchestrationContext and updates entity operations to use generated UUIDs |
| durabletask/internal/helpers.py | Updates new_call_entity_action() and new_signal_entity_action() function signatures to accept request_id parameter |
| tests/durabletask/test_orchestration_e2e.py | Adds test validating UUID uniqueness before and after orchestration replay |
| tests/durabletask-azuremanaged/test_dts_orchestration_e2e.py | Adds test validating UUID uniqueness before and after orchestration replay for Azure-managed scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@andystaples I've opened a new pull request, #84, to work on those changes. Once the pull request is ready, I'll request review from you. |
berndverst
left a comment
There was a problem hiding this comment.
Is there any concern with upgrading to this while orchestrations are already running?
If those are then replayed, wouldn't the behavior effectively change?
If so, we probably will need to list this as a breaking change.
|
No, the IDs that are affected by this PR are not checked again, during replay we use the ID from the history event with matching Task ID instead. |
Adds new_uuid to the OrchestrationContext to allow generating replay-safe UUIDs. Also update entity messages to use UUIDs generated using this method as requestIds. This is a prerequisite for working with azure functions as the older entity protocol requires these IDs to be parsed as GUID in the .NET.