do not disconnect on receiving canceled request (#3869)
LC cancels concurrent requests if one peer sent a correct response and waiting for other peers is no longer useful. On the server side this resulted in a descore (-500) and a likely disconnect. The behaviour is changed to match `UnexpectedEOF`, `PotentiallyExpectedEOF` handling that return an error response without disconnecting from the peer.
This commit is contained in:
parent
dbd3d02e63
commit
c3f9844de1
|
@ -1024,8 +1024,12 @@ proc handleIncomingStream(network: Eth2Node,
|
|||
try:
|
||||
awaitWithTimeout(
|
||||
readChunkPayload(conn, peer, maxChunkSize(MsgRec), MsgRec), deadline):
|
||||
returnInvalidRequest(
|
||||
# Timeout, e.g., cancellation due to fulfillment by different peer.
|
||||
# Treat this similarly to `UnexpectedEOF`, `PotentiallyExpectedEOF`.
|
||||
await sendErrorResponse(
|
||||
peer, conn, InvalidRequest,
|
||||
errorMsgLit "Request full data not sent in time")
|
||||
return
|
||||
|
||||
except SerializationError as err:
|
||||
returnInvalidRequest err.formatMsg("msg")
|
||||
|
|
Loading…
Reference in New Issue