diff --git a/CHANGELOG.md b/CHANGELOG.md index ad768b9..4366090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Updates * Replace hardcoded version string + globs with build variables ([#213](https://github.com/microsoft/durabletask-mssql/pull/213)) +* Fix deadlock issue on orchestration creation ([#218](https://github.com/microsoft/durabletask-mssql/pull/218)) - contributed by [@microrama](https://github.com/microrama) ## v1.2.3 diff --git a/src/DurableTask.SqlServer/Scripts/logic.sql b/src/DurableTask.SqlServer/Scripts/logic.sql index 9e6fef2..e6807d8 100644 --- a/src/DurableTask.SqlServer/Scripts/logic.sql +++ b/src/DurableTask.SqlServer/Scripts/logic.sql @@ -260,6 +260,7 @@ BEGIN IF @existingStatus IN (SELECT value FROM STRING_SPLIT(@DedupeStatuses, ',')) BEGIN DECLARE @msg nvarchar(4000) = FORMATMESSAGE('Cannot create instance with ID ''%s'' because a pending or running instance with ID already exists.', @InstanceID); + ROLLBACK TRANSACTION; THROW 50001, @msg, 1; END ELSE IF @existingStatus IS NOT NULL