Skip to content

[Bug]: ZooKeeper recovery signals are dropped while provider reload is in progress #52

Backlog

Description

@CarolDestiny

What happened?

If ZooKeeper recovers from a newer session loss while DubboClient.ReLoadDubboDriverCollection is still running for an earlier recovery, the second reload request returns immediately. Services already visited by the first pass aren't revisited. If those services' watches were installed on the expired session, they may stop receiving provider changes and keep stale routes.

Expected: An intervening recovery that invalidates previously installed watches schedules a follow-up refresh for A, without requiring two reload passes to run concurrently.

Actual: A is refreshed once. The guard skips the second request and no follow-up is scheduled.

How can we reproduce it? (optional)

  1. Register two service drivers, A and B, with an in-memory registry reader. Arrange for the reload to finish reading A, then pause B's read at a TaskCompletionSource.
  2. While B's read is paused, invoke ReLoadDubboDriverCollection again to model a newer recovery request.
  3. Release B's read and await both reload calls. Count how many times A was refreshed.

Environment

Equivalent unit tests fail on b4b4500 and b9dce71 (apache/dubbo-net#48), with .NET 10 and with the netstandard2.0 library on .NET 8. This reproduces the reload scheduling bug, not the delivery of an actual ZooKeeper session event. Windows. The test uses a controlled registry reader; no live ZooKeeper server is needed.

Suggested direction

Coalesce duplicate notifications, but retain a pending refresh for a newer recovery that arrives during an active reload. Add a gated test that confirms services already visited are refreshed again when the newer recovery requires it.

Relevant code on the baseline

Related: apache/dubbo-net#37 covers an exception leaving the reload guard stuck. The overlapping request here is dropped even when the active reload finishes successfully.

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