azure-functions-sql-extension icon indicating copy to clipboard operation
azure-functions-sql-extension copied to clipboard

SQL Trigger Deadlock exception

Open VasuBhog opened this issue 2 years ago • 2 comments

As I was testing a SQL Trigger in deployed Azure Function App. I was using Application Insights to test logging for the trigger and found a few failed checks that all had the same issue.

Pricing Plan: Y1 East US OS: Windows Functions Runtime: 4.19.0.20414 "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", "version": "[4.*, 5.0.0)" }

SQL Connection: Azure SQL DB Serverless (max vCores - 10, standard gen5).

Error: Failed to check for changes in table 'dbo.Products' due to exception: Microsoft.Data.SqlClient.SqlException. Exception message: Transaction (Process ID 76) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Both the Executing and Executed statements did not have an error and processed as expected.

VasuBhog avatar May 05 '23 21:05 VasuBhog

Putting in trigger GA to make sure we have a plan for how to handle deadlock issues.

Charles-Gagnon avatar Jun 13 '23 18:06 Charles-Gagnon

Check logs to see if this error is just not a one off case and any of the customers ran into this and we can get a better understanding to add proper documentation on how to handle these deadlock cases.

MaddyDev avatar Jun 28 '23 21:06 MaddyDev