Skip to content

Commit

Permalink
Rollback transaction in CreateInstance stored proc to prevent deadloc…
Browse files Browse the repository at this point in the history
…ks (#218)

Co-authored-by: RAMAKANT BHANDARU <rbhandaru@mtb.com>
  • Loading branch information
microrama and RAMAKANT BHANDARU committed May 7, 2024
1 parent d6e0361 commit a9a1a71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/DurableTask.SqlServer/Scripts/logic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9a1a71

Please sign in to comment.