forked from LBRYCommunity/lbry-sdk
cancel dht response future
This commit is contained in:
parent
a882f2e8c5
commit
63bf084a6a
1 changed files with 4 additions and 0 deletions
|
@ -524,6 +524,10 @@ class KademliaProtocol(DatagramProtocol):
|
||||||
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
|
response = await asyncio.wait_for(response_fut, self.rpc_timeout)
|
||||||
self.peer_manager.report_last_replied(peer.address, peer.udp_port)
|
self.peer_manager.report_last_replied(peer.address, peer.udp_port)
|
||||||
return response
|
return response
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
if not response_fut.done():
|
||||||
|
response_fut.cancel()
|
||||||
|
raise
|
||||||
except (asyncio.TimeoutError, RemoteException):
|
except (asyncio.TimeoutError, RemoteException):
|
||||||
self.peer_manager.report_failure(peer.address, peer.udp_port)
|
self.peer_manager.report_failure(peer.address, peer.udp_port)
|
||||||
if self.peer_manager.peer_is_good(peer) is False:
|
if self.peer_manager.peer_is_good(peer) is False:
|
||||||
|
|
Loading…
Add table
Reference in a new issue