sqlinsight-pro/tests/SQLInsight.Collectors.Tests
Søren Eggert Lundsteen Olsen 25a67cb98b Stop SQLInsight deadlocking itself, and stop reporting its own deadlocks
At a customer whose repository sits on a monitored instance, the agent
reported 12 deadlocks that were its own: two instances' monitors save
findings in parallel, one transaction each, and while insight.Findings is
small SQL Server scans it, so the two lock each other's rows.

- SaveRuleResultsAsync takes an exclusive application lock for its
  transaction (the agent is the only writer; a save takes milliseconds)
  and retries if chosen as deadlock victim anyway
- repository connections are named "SQLInsight Pro (repository)"
- deadlocks where every participant is SQLInsight Pro are not reported
  (the read position still moves past them); any other session keeps it

The new integration test (two instances saving 25 rules x 40 rounds in
parallel) failed 2 of 2 without the fix and passed 5 of 5 with it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 07:34:59 +02:00
..
DeadlockParserTests.cs Stop SQLInsight deadlocking itself, and stop reporting its own deadlocks 2026-10-02 07:34:59 +02:00
ShowplanAnalyzerTests.cs Fase 2: plan cache analysis 2026-09-29 07:40:09 +00:00
Sql2005CompatibilityTests.cs SQL Server 2005: fix agent jobs and plan analysis, guard against 2008+ syntax 2026-10-01 15:51:39 +02:00
SQLInsight.Collectors.Tests.csproj Fase 1: collectors and rule pack (41 rules) 2026-09-29 06:17:08 +00:00
SqlSelectionTests.cs Fase 2: Always On availability groups and SQL Agent jobs 2026-09-29 07:53:49 +00:00