Skip to content

Commit 6258651

Browse files
authored
Merge pull request #3716 from lbryio/dht_exceptions
handle remote exceptions on routing table ping
2 parents f64d507 + cc5f0b6 commit 6258651

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lbry/dht/protocol/routing_table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from lbry import utils
1010
from lbry.dht import constants
11+
from lbry.dht.error import RemoteException
1112
from lbry.dht.protocol.distance import Distance
1213
if typing.TYPE_CHECKING:
1314
from lbry.dht.peer import KademliaPeer, PeerManager
@@ -395,7 +396,7 @@ async def add_peer(self, peer: 'KademliaPeer', probe: typing.Callable[['Kademlia
395396
try:
396397
await probe(to_replace)
397398
return False
398-
except asyncio.TimeoutError:
399+
except (asyncio.TimeoutError, RemoteException):
399400
log.debug("Replacing dead contact in bucket %i: %s:%i with %s:%i ", bucket_index,
400401
to_replace.address, to_replace.udp_port, peer.address, peer.udp_port)
401402
if to_replace in self.buckets[bucket_index]:

0 commit comments

Comments
 (0)