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

オープン
#3,192 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
567
フォーク
107
平均マージ
1時間 19分
マージ済み PR(30日)
353

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。