On SQL Server a wait for another process's migrations fails at the command timeout without naming the lock

Ouverte
#3,192 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
58/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
csharp
Domaine
databases

Piste de recherche

Start by reading the SQL Server migrations lock handling and the SQLite lock behavior added for #3177, then inspect the related changes in #3186. Add SQL Server coverage that holds the application lock in another session and checks that waiting exceeds the command timeout, logs one warning, and ends with the lock named; confirm migration command timeouts remain unchanged. Update the operations documentation to describe what operators see.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:storage type:bug

Problem

On SQL Server, EF Core takes the migrations lock with sp_getapplock on __EFMigrationsLock, with a session owner and no lock timeout, outside the execution strategy. A fluentcms migrate or a host start that waits for another process's migration for longer than the command timeout, 30 seconds by default, fails with SqlException: Execution Timeout Expired, which names neither the lock nor the other process. It does not hang, a killed holder's session releases the lock, and a second run works; but parallel init containers hit it on any migration that takes longer than 30 seconds.

Found while fixing #3177 (#3190), which bounds the same wait on SQLite and names the row. Reproduced there on SQL Server 2025 by holding the application lock from another session.

Proposal

The runner waits for the lock itself on SQL Server, with the warning and the bound it has on SQLite, and fails with an error that names the lock and says that another process is migrating; a timeout of a migration command itself must stay what it is.

Acceptance

  • A start or migrate on SQL Server that waits for another session's migrations lock waits past the command timeout, logs the warning once, and ends with the lock or with an error that names it
  • A test holds it on SQL Server
  • The operations documentation says what an operator sees

Size: S. Goes to main, as bugs do. After #3186, which works in the same files.

Langage dominant
C#
Étoiles
567
Forks
107
Merge moyen
1 h 19 min
PR mergées (30 j)
353

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de fluentcms/FluentCMS

Toutes les issues de fluentcms/FluentCMS

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.