Deleting an API can leave a listing on an API Portal when a publish records its row after the last unpublish pass
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
Hướng nghiên cứu
Start by reading the UnpublishEverywhere, Publish, and withdrawIfArtifactDeleted paths from PR #4317, then trace the artifact schema and migrations for each SQL dialect. Add a regression test for the stated ordering and check that a publish during deletion is refused or withdrawn and that a failed delete clears the marker. Done means the deleted API's portal listing is withdrawn and the API can be published again after a failed delete.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Deleting an API first unpublishes it from every API Portal it is live on (UnpublishEverywhere, #4317), and only then removes the artifact, which cascades its api_publications rows away. Publish takes no lock shared with the delete: it pushes the listing to the portal, then records its row.
#4317 covers two orderings:
- a publish whose row lands while the delete is unpublishing is caught by a later pass (up to 3 passes);
- a publish that cannot record its row because the API is already gone withdraws its own listing (
withdrawIfArtifactDeleted).
One ordering is still open:
- The delete's last pass reads the publications.
- A concurrent
Publishpushes to a portal and records its row. - The delete removes the artifact, and the cascade removes that new row.
The portal keeps serving the deleted API, and no row is left to unpublish it from. CodeRabbit raised this on #4317 (thread).
Proposed fix
Mark the API as being deleted before the unpublish passes, and make Publish's record step fail atomically when the API is marked. For example, promote the draft only while the artifact is not marked, in the same statement.
- A publish recorded before the mark exists when the passes run, so it is unpublished.
- A publish that tries to record after the mark fails, and
withdrawIfArtifactDeleted(extended to the marked state) withdraws its listing. - A failed delete clears the mark.
This needs a nullable or defaulted marker on the artifact. It is an additive schema change, applied to every dialect with its ALTER TABLE. Holding a row lock across the portal HTTP calls instead would keep a database lock open during network I/O, so it is not preferred.
Done when
- A test reproduces the ordering above (delete's last read, then publish records, then artifact removal) and the listing is withdrawn.
- A publish attempted while the API is being deleted is refused or withdrawn, and a delete that fails leaves the API publishable again.
- Ngôn ngữ chính
- Go
- Star
- 85
- Fork
- 137
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 247
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
wso2/api-platform#4369 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsĐang mởArea/Policies Aspect/Other Severity/Trivial Type/Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
wso2/api-platform#4355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wso2/api-platform#4348 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Aspect/AI Aspect/API. Severity/Major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
wso2/api-platform#4343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creationĐang mởArea/Policies Aspect/Configuration Severity/Minor Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
wso2/api-platform#4330 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wso2/api-platform
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
progress-deadline annotation accepts "0s" although validation says it must be positiveCó thể đã có người làm @BahaaMattar đã nhận hôm nay. Đang mởarea/API kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
api cleanup
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
router-for-me/CLIProxyAPI#7708 ·
Maintainer thường phản hồi trong vòng 1 ngày