Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Timeout Management #244

@dirkmc

Description

@dirkmc

When a Bitswap Session fetches a block it sends want-haves to all the peers in the session, and a single "optimistic" want-block to one of the peers. If the peer that receives the want-block responds with DONT_HAVE, the Session checks the other responses and sends want-block to any peer that responded with HAVE.

If a peer that receives a want-block doesn't respond, the Session will hang. A peer may not respond because:

  • It is overloaded / network issues
  • older versions of Bitswap do not send a response if they don't have a block

Proposed solution:

  • Detect timeouts in the MessageQueue (which knows which version of Bitswap the peer supports)
  • The MessageQueue informs the Session of timeouts, including whether it's an older version of Bitswap
  • When the Session gets a timeout for a CID
    • if it's from a peer running an older version of Bitswap, treat it as a DONT_HAVE
    • if it's from a peer running a newer version of Bitswap, remove the peer from the Session

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