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

Đang mở
#3,192 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C#
Star
567
Fork
107
Merge trung bình
1 giờ 19 phút
Pull request đã merge (30 ngày)
353

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluentcms/FluentCMS

Tất cả issue của fluentcms/FluentCMS

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.