Skip to content

Failures during add_hookspecs / historic replay leave partial state聽#761

Description

@RonnyPfannschmidt

馃 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions