Skip to content

fix(dash-spv): route can record a request on a departed peer #1515

Backlog

Description

@xdustinface

Broker::route checks is_closed before each send, but records the sent requests as OnWire only after the send loop. If a peer hangs up in between, the pump handles PeerEvent::Disconnected and calls requeue_from while those requests are still Queued. route then records them as on the wire at a peer that is gone.

Nothing is lost, but the requests wait for expire to notice them, so a lowest filter batch or block can hold up progress for a request timeout (10 s).

A fix has to make the registration in route and the cleanup in requeue_from agree under the broker lock. Cancelling the connection's token when its reader ends is not enough on its own: PeerSet::admit does not check the token, so a connection that drops before its admission would keep a peer slot without ever owing anything a timeout could catch.

Found while reviewing #1473, which does not change this path.

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