Skip to content

fix(whatsrust): avoid lifecycle handler registration deadlock #359

Description

@Andiveli

Problem

Startup can deadlock when C_Connect registers event handlers while holding the lifecycle mutex and the production registration callback calls clientSnapshot, which re-enters that mutex.

Proposed solution

Coordinate once-only registration under the lifecycle mutex, execute the registration callback outside it, and allow a panic to reset registration so a later attempt can retry. Add bounded behavior and concurrency regression coverage.

Acceptance criteria

  • Registration callbacks never execute while the lifecycle mutex is held.
  • Concurrent callers register handlers exactly once.
  • A panicking registration does not permanently mark handlers as registered.
  • Focused Go tests, go test ./..., go vet ./..., formatting, and whitespace checks pass.

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

    status:approvedIssue approved for implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions