-
Notifications
You must be signed in to change notification settings - Fork 18
Description
The metrics implementation exposed an abnormal behaviour in our state tracking:

It looks like the following data structure grows over time:
litep2p/src/protocol/notification/mod.rs
Lines 261 to 262 in 28d42c6
/// Pending outboudn substreams. | |
pending_outbound: HashMap<SubstreamId, PeerId>, |
Elements are added to the hashmap on:
litep2p/src/protocol/notification/mod.rs
Line 919 in 28d42c6
async fn on_open_substream(&mut self, peer: PeerId) -> crate::Result<()> { litep2p/src/protocol/notification/mod.rs
Line 1093 in 28d42c6
async fn on_validation_result(
Elements are removed from the hashmap on:
litep2p/src/protocol/notification/mod.rs
Line 514 in 28d42c6
async fn on_outbound_substream( litep2p/src/protocol/notification/mod.rs
Line 816 in 28d42c6
async fn on_substream_open_failure(
Possible causes
It looks like we should remove the state on the connection closed as well:
litep2p/src/protocol/notification/mod.rs
Line 445 in 28d42c6
OutboundState::OutboundInitiated { .. } |