Skip to content

p2p: Improved peer lifecycle management #3679

@brapse

Description

@brapse

Peer lifecycle management is devided between the Reactors and Switch. The Switch acts as intermediary, creating peers with references to the reactors as well as calling reactor.AddPeer to start reactor specific go routines. These go-routines depend peer state which must be initialized by the reactor in reactor.InitPeer. The spreading of responsibility has led to several issues when Reactors and the Switch have mismatched expectations around peer state (#3346 , #3338)

In order to specify and verify the lifecycle of peer, it would be helpful to refactor the current implementation into a schema that leaves a single entity responsible for Start/Stopping a peer and
communicate its state to other components and avoid race conditions.

This issue probably falls within the purview of the greater p2p refactor #2067

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions