sqlinsight-pro/src/SQLInsight.Repository
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
..
Migrations Top SQL: collect what the heaviest statements use every 5 minutes 2026-10-01 15:46:45 +02:00
InsightRepository.Analysis.cs Top SQL: collect what the heaviest statements use every 5 minutes 2026-10-01 15:46:45 +02:00
InsightRepository.cs Stop SQLInsight deadlocking itself, and stop reporting its own deadlocks 2026-10-02 07:34:59 +02:00
InsightRepository.Hub.cs Customers file support cases in SQLInsight Web and follow their status 2026-10-01 11:34:06 +02:00
InsightRepository.Integration.cs Fase 4: integration with Prometheus, Grafana, SCOM and scripts 2026-09-29 09:56:01 +00:00
InsightRepository.Maintenance.cs Top SQL: collect what the heaviest statements use every 5 minutes 2026-10-01 15:46:45 +02:00
InsightRepository.Read.cs Fase 2: Azure SQL Managed Instance, docs and rule catalog test 2026-09-29 08:23:40 +00:00
InsightRepository.Reports.cs Fase 4: management and compliance reports as PDF 2026-09-29 10:09:10 +00:00
InsightRepository.Support.cs Customers file support cases in SQLInsight Web and follow their status 2026-10-01 11:34:06 +02:00
InsightRepository.Updates.cs Fase 3: signed updates of rule packs and the application 2026-09-29 09:19:41 +00:00
SchemaMigrator.cs Fase 1: local repository with finding tracking, time series and retention 2026-09-29 06:23:38 +00:00
SQLInsight.Repository.csproj Fase 1: on-prem web UI (IIS or Windows service), light design system 2026-09-29 06:58:51 +00:00