litep2p
litep2p copied to clipboard
kad: Include a timeout for `QueryExecutor::send_message`
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.