Create queue for network events when channel is full #704
Labels
Network
Libp2p and PubSub stuff
Priority: 4 - Low
Limited impact and can be implemented at any time
Type: Enhancement
Issue summary
Currently, if the channel is full, the event is ignored with an error log to avoid stalling the libp2p task:
forest/node/forest_libp2p/src/service.rs
Line 285 in 3411459
but it would be ideal to create some buffer (with something like
VecDeque
) when the channel is full to hold these pending events to send into the channel when the channel empties.How the send from the queue is triggered can be done a few ways, but either just through a check at the start of the libp2p thread poll or as a future that is part of the
select!
are the ones that come to mind.If this error is logged on other's ends we can also consider increasing the network event channel size (currently 50) to avoid this case, but I have yet to see the error log.
cc: @AshantiMutinta
Other information and links
The text was updated successfully, but these errors were encountered: