From 0a0f4daf9d3539ad75e4c50a96ccb910337e3813 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 3 Nov 2020 10:37:00 +0000 Subject: [PATCH] Prevent errors for stream termination race (#1853) Prevents an error being propagated on a race condition for RPC stream termination --- beacon_node/eth2_libp2p/src/rpc/handler.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beacon_node/eth2_libp2p/src/rpc/handler.rs b/beacon_node/eth2_libp2p/src/rpc/handler.rs index 93f26eed8..24201ceeb 100644 --- a/beacon_node/eth2_libp2p/src/rpc/handler.rs +++ b/beacon_node/eth2_libp2p/src/rpc/handler.rs @@ -912,6 +912,8 @@ async fn process_inbound_substream( substream_closed = true; } } + } else if matches!(item, RPCCodedResponse::StreamTermination(_)) { + // The sender closed the stream before us, ignore this. } else { // we have more items after a closed substream, report those as errors errors.push(RPCError::InternalError(