Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.53k stars 296 forks source link

Convert timer target to UTC #1138

Closed AnatoliB closed 4 months ago

AnatoliB commented 4 months ago

Fixes #1127

The old Azure SDK (e.g. WindowsAzure.Storage v9.3.1) silently converts non-UTC datetime values to UTC before persisting them in a table. As a result, passing non-UTC datetime to CreateTimer worked, even though this is not a recommended pattern.

The new Azure SDK (e.g. Azure.Data.Tables v12.8.3) throws an exception on attempts to persist non-UTC datetime values, which causes a hard-to-diagnose issue later, after a successful CreateTimer invocation.

This fix makes sure CreateTimer always converts the provided datetime value to UTC, to match the end-to-end behavior after the Azure SDK upgrade.

Since this is a potentially breaking change to both DurableTask.Core and DurableTask.AzureStorage, it should be released only with DurableTask.Core v2 and DurableTask.AzureStorage v2.

2024-07-18 update: we decided to limit this fix to DurableTask.AzureStorage only, so no impact to DurableTask.Core