Skip to content

[bug] A dropped asyncClearBacklog callback pins the broker's backlog-clear fence and the buffering gate forever #27709

Open

Description

@nodece

Search before reporting

  • I searched in the issues and found nothing similar.

Motivation

From the review of #27666: PersistentSubscription.clearBacklog() releases its inProgressBacklogClearFuture fence and the dispatcher's buffering gate only from the clearBacklogComplete / clearBacklogFailed callbacks of ManagedCursor#asyncClearBacklog. The synchronous-throw case is handled on the broker side (handleClearBacklogStartupFailure), but if managed-ledger accepts the call and then never invokes the callback at all, the fence stays set forever: every later clearBacklog() queues behind the stuck one and never runs, and the dispatcher keeps buffering delayed entries with no release.

This issue tracks the managed-ledger side:

  • audit asyncClearBacklog and its internal reset/delete paths to confirm whether a path exists that accepts the callback and never completes it (or completes it twice);
  • if such paths exist, fix them so every accepted invocation eventually calls exactly one of clearBacklogComplete / clearBacklogFailed;
  • alternatively, give callers a way to detect and recover a dropped callback (a timeout or a cancellation hook).

Note: I don't have a concrete reproducer for a dropped callback; this comes from the lifecycle review discussion on the broker side. The first step is to determine whether such a path exists in the current code.

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