Skip to content

Retry chains multiply while a subscription is disconnected #41

Closed

Description

@vheathen

Retry chains multiply while a subscription is disconnected. A subscription that lost its lock to another node keeps its PubSub subscription, and each event notification it gets in :disconnected schedules another :subscribe_to_stream retry without cancelling the earlier ones (3 of 3, same at f1c5d29). Ten notifications per second for an hour imply roughly 600 scheduled lock attempts per second at the default retry interval, all going to the node's single lock server; the reachable rate was not measured. Fencing adds another way into this state. Medium: any multi-node deployment where another node wins the reclaim after a lock loss.

Part of the review of main at 1f9d1f8: #27 (comment)

Activity

  1. yordis commented on Oct 27, 2026

    @yordis
    Member

    Fixed by #70. An event notification heard while disconnected no longer schedules another :subscribe_to_stream retry, so a disconnected subscription keeps a single retry pending.

    Verified with test/subscriptions/subscription_locking_test.exs ("keeps a single retry pending however many events it hears about"): it fails against the code before #70 and passes on main.

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