paritytech / litep2p

Peer-to-peer networking library
MIT License
68 stars 10 forks source link

ping: Make ping fault tolerant wrt outbound substreams races #133

Closed lexnv closed 4 months ago

lexnv commented 4 months ago

We have discovered a race between the TransportService and Protocol interface.

This issue was first seen on the identify protocol:

After looking a bit closely into it, indeed there might be a chance for the following to happen:

This PR replaces the todo! in case of the race with a warning, and we'll no longer panic.

It is still good to capture those as warnings for visibility, even if there's no implied side-effect on our code.