chore: handle full peer request channel (#4211)

This commit is contained in:
Matthias Seitz
2023-08-15 18:29:53 +02:00
committed by GitHub
parent bdcc56bbf6
commit 7f83d0a05a
2 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,8 @@ pub struct TransactionsManagerMetrics {
pub(crate) messages_with_already_seen_transactions: Counter,
/// Number of transactions about to be imported into the pool.
pub(crate) pending_pool_imports: Gauge,
/// How often we failed to send a request to the peer because the channel was full.
pub(crate) egress_peer_channel_full: Counter,
}
/// Metrics for Disconnection types

View File

@ -341,6 +341,10 @@ where
if peer.request_tx.try_send(req).is_ok() {
self.inflight_requests.push(GetPooledTxRequest { peer_id, response: rx })
} else {
// peer channel is saturated, drop the request
self.metrics.egress_peer_channel_full.increment(1);
return
}
if num_already_seen > 0 {