litep2p icon indicating copy to clipboard operation
litep2p copied to clipboard

kad: Include a timeout for `QueryExecutor::send_message`

Open lexnv opened this issue 5 months ago • 0 comments

Sending a plain message using the query executor does not take into account timeouts:

https://github.com/paritytech/litep2p/blob/e3a22d5cfbf255e74be1acceb3ea6ec0baa43c09/src/protocol/libp2p/kademlia/executor.rs#L136-L139

The other methods of the query executor bound the total time to the READ_TIMEOUT constant: https://github.com/paritytech/litep2p/blob/e3a22d5cfbf255e74be1acceb3ea6ec0baa43c09/src/protocol/libp2p/kademlia/executor.rs#L161-L166

Introduce a new variable WRITE_TIMEOUT and ensure writes are timedout as well.

lexnv avatar Sep 03 '24 10:09 lexnv