Site deletion can orphan entries, and the plugin and site caches reload under every request at once

Đang mở
#3,306 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
48/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
backend, databases, performance

Hướng nghiên cứu

Start with Sites/SiteManager.cs:176-181 and Storage/SystemModelBuilder.cs to trace site deletion and document storage; compare SiteManager.cs:418-422 for the existing NOT EXISTS pattern. Then read the content write transaction and the cache refresh paths in Plugins/PluginState.cs:88-108, src/plugins/FluentCMS.Plugins.MultiSite/SiteHostMap.cs:36-56, and Sites/SiteCache.cs. Done means all four acceptance cases have tests and pass.

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

Mô tả

area:content area:storage type:bug

Problem

  1. Site deletion can orphan content. Sites/SiteManager.cs:176-181 checks for documents and then deletes the site as two statements with no transaction. cms_document has no foreign key to the site (Storage/SystemModelBuilder.cs), while locales and roles cascade. Other instances keep the site cached for 30 s (Sites/SiteCache.cs:15, Sites/SiteResolver.cs:107-110). An entry created between the check and the delete, or on another instance within 30 s, is left in a site that no longer exists and cannot be reached, restored or purged through the API.
  2. The plugin and site caches reload under every request at once. Plugins/PluginState.cs:88-108 and src/plugins/FluentCMS.Plugins.MultiSite/SiteHostMap.cs:36-56 have a fixed 30 s lifetime and no single-flight, so every request arriving after expiry runs the query. SiteCache.Invalidate() clears every key (Sites/SiteCache.cs:89-94).

Paths are under src/FluentCMS.Core/ unless they start with src/.

Proposal

  • Delete with NOT EXISTS in one statement, as RemoveLocaleAsync does (SiteManager.cs:418-422), and re-check the site inside the content write transaction.
  • Refresh each cache once, serving the previous copy to other callers meanwhile.

Acceptance

  • A site that gains an entry during deletion is not deleted
  • A write to a site deleted on another instance is refused
  • Concurrent requests after expiry run one refresh query
  • Tests for each

Found in the code review of 17 Nov 2026.

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

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.