rust-ipfs icon indicating copy to clipboard operation
rust-ipfs copied to clipboard

bitswap: Timeout peers who have not respond

Open dariusc93 opened this issue 9 months ago • 0 comments

Currently, we would send a message with sendDontHave being true, however not all bitswap implementations would act on this field or may ignore it causing us to wait as a result. What we should do instead is add a timeout to each peer when we send a request and if a message does not arrive before it timeout then we should pop the peer from the session or move them into a separate queue to be removed so when the session is polled again we can send a cancel request as we remove them, but if they respond before this happen, we could move them back into the session.

dariusc93 avatar May 10 '24 16:05 dariusc93