Skip to content

notifications: Investigate possible memory leak with pending outbound substream tracking #295

@lexnv

Description

@lexnv

The metrics implementation exposed an abnormal behaviour in our state tracking:

Screenshot 2024-12-02 at 11 17 17

It looks like the following data structure grows over time:

/// Pending outboudn substreams.
pending_outbound: HashMap<SubstreamId, PeerId>,

Elements are added to the hashmap on:

Elements are removed from the hashmap on:

Possible causes

It looks like we should remove the state on the connection closed as well:

OutboundState::OutboundInitiated { .. }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions