-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant timeout exceptions #959
Comments
Could you please provide us with the following information: Do you have any custom timeout defined on the server (default is 15 sec) or are there any custom configuration(s) to consider and what type of database are you targeting. It would also help to know if this is a heavily used database. |
We need more info to debug your particular issue. If you could attach your logs to the issue, it would help us fix the issue much faster.
{
"logging": {
"fileLoggingMode": "always",
"logLevel": {
"default": "Debug"
}
}
}
NOTE Debug logging will include information such as Database and table names, if you do not wish to include this information you can either redact it from the logs before attaching or let us know and we will provide a way to send logs directly to us. |
Hey @Astral100 - I'm currently looking into this and have identified some improvements we can make that should help with the issues you've encountered related to the timeouts. In the meantime though, one thing that I'll need some help with is understanding what the queries our extension is running are getting deadlocked on. To do this you'll need to create an event session and then wait for another deadlock to occur. The steps to do so are as follows (from https://learn.microsoft.com/en-us/azure/azure-sql/database/analyze-prevent-deadlocks)
CREATE EVENT SESSION [deadlocks] ON DATABASE
ADD EVENT sqlserver.database_xml_deadlock_report
ADD TARGET package0.ring_buffer
WITH (STARTUP_STATE=ON, MAX_MEMORY=4 MB)
GO
ALTER EVENT SESSION [deadlocks] ON DATABASE
STATE = START;
GO
DECLARE @tracename sysname = N'deadlocks';
WITH ring_buffer AS (
SELECT CAST(target_data AS XML) as rb
FROM sys.dm_xe_database_sessions AS s
JOIN sys.dm_xe_database_session_targets AS t
ON CAST(t.event_session_address AS BINARY(8)) = CAST(s.address AS BINARY(8))
WHERE s.name = @tracename and
t.target_name = N'ring_buffer'
), dx AS (
SELECT
dxdr.evtdata.query('.') as deadlock_xml_deadlock_report
FROM ring_buffer
CROSS APPLY rb.nodes('/RingBufferTarget/event[@name=''database_xml_deadlock_report'']') AS dxdr(evtdata)
)
SELECT
d.query('/event/data[@name=''deadlock_cycle_id'']/value').value('(/value)[1]', 'int') AS [deadlock_cycle_id],
d.value('(/event/@timestamp)[1]', 'DateTime2') AS [deadlock_timestamp],
d.query('/event/data[@name=''database_name'']/value').value('(/value)[1]', 'nvarchar(256)') AS [database_name],
d.query('/event/data[@name=''xml_report'']/value/deadlock') AS deadlock_xml,
LTRIM(RTRIM(REPLACE(REPLACE(d.value('.', 'nvarchar(2000)'),CHAR(10),' '),CHAR(13),' '))) as query_text
FROM dx
CROSS APPLY deadlock_xml_deadlock_report.nodes('(/event/data/value/deadlock/process-list/process/inputbuf)') AS ib(d)
ORDER BY [deadlock_timestamp] DESC;
GO
Then for 3 (to start with) of the deadlocks to start with respond with the That'll be enough for now, and I'll update as we make changes for the other issues as those happen! |
Hello @Charles-Gagnon, I have tried to run above queries during the last time when deadlocks were occurring, but I was not getting anything back (just empty results). I tried running those queries on both main and master databases. We did however get the deadlock graph analysed with the Microsoft support engineer, and it seems that these 2 queries were causing deadlocks: Query 1 (SQL Trigger query):
Query 2 (Our query that updates a few records in the table):
Both of these queries have been fired several times in parallel as well. There is a more detailed analysis in the email performed by the Microsoft engineer that I asked to be shared with your team as well. Hopefully this can give an idea on what is causing it. |
Thanks for adding the info! I'm working with the CSS & SQL folks to figure out what exactly is the problem here, so I'll continue to go through that channel for requesting more information. I'll continue to update this thread with anything generally relevant or the final results of our investigation once we have them! |
Final result of our investigation :
I'll close this issue then since we have the above issues for tracking, and if you see anything else (especially deadlocks again) let us know and we can investigate some more! |
Hello,
I have 6 SQL trigger functions running on the same DB (different tables), and I constantly get timeout exceptions in the logs.
I wonder what could be the reason?
Here is an example of one such log:
After some time it recovers and keeps working and then starts failing again.
I wonder what could be the reason?
I have 6 SQL trigger functions running at the moment. Usually only 1 or 2 from them is actually used in a single point of time.
The text was updated successfully, but these errors were encountered: