Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Failures during add_hookspecs / historic replay leave partial state

Đang mở
#761 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

@xiehuanyi đang làm issue này rồi.

Từ ngày 11/10/2026.

  • #779 của @xiehuanyi — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
devtools

Hướng nghiên cứu

Start with add_hookspecs() and the _verify_hook call that can raise for an already-registered impl, then see where set_specification() installs the spec before that check runs. Next, look at register() and the comment near _maybe_apply_history, which admits a failed replay leaves the plugin half-registered. Done means a failed add_hookspecs leaves no spec behind so a retry succeeds, and a failed replay in register() rolls the registry back. The issue does not say how rollback should be structured, so confirm the approach with maintainers before writing it.

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

Mô tả

🤖 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.

  • add_hookspecs(): if _verify_hook raises for an already-registered impl, the spec stays installed via set_specification(). A retry then raises ValueError: Hook 'h' is already registered within namespace ..., even after unregistering the bad plugin.
  • register(): if a historic replay (_maybe_apply_history) raises, the plugin stays in the registry with only the hookimpls processed before the failure. The code comment there acknowledges this.

Proposal: validate first and install afterwards in add_hookspecs. For the replay case, roll back on exception.

Found while working on #759.

Ngôn ngữ chính
Python
Star
1.7k
Fork
172
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
21

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 pytest-dev/pluggy

Tất cả issue của pytest-dev/pluggy

Issue tương tự

Thêm issue về Python

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.