Skip to content

Commit a9a1a71

Browse files
microramaRAMAKANT BHANDARU
and
RAMAKANT BHANDARU
authored
Rollback transaction in CreateInstance stored proc to prevent deadlocks (#218)
Co-authored-by: RAMAKANT BHANDARU <[email protected]>
1 parent d6e0361 commit a9a1a71

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Updates
66

77
* Replace hardcoded version string + globs with build variables ([#213](https://github.com/microsoft/durabletask-mssql/pull/213))
8+
* Fix deadlock issue on orchestration creation ([#218](https://github.com/microsoft/durabletask-mssql/pull/218)) - contributed by [@microrama](https://github.com/microrama)
89

910
## v1.2.3
1011

src/DurableTask.SqlServer/Scripts/logic.sql

+1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ BEGIN
260260
IF @existingStatus IN (SELECT value FROM STRING_SPLIT(@DedupeStatuses, ','))
261261
BEGIN
262262
DECLARE @msg nvarchar(4000) = FORMATMESSAGE('Cannot create instance with ID ''%s'' because a pending or running instance with ID already exists.', @InstanceID);
263+
ROLLBACK TRANSACTION;
263264
THROW 50001, @msg, 1;
264265
END
265266
ELSE IF @existingStatus IS NOT NULL

0 commit comments

Comments
 (0)