Skip to content

Commit

Permalink
handle remote exception on routing table ping
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Dec 1, 2022
1 parent 001819d commit 3669beb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lbry/dht/protocol/routing_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from lbry import utils
from lbry.dht import constants
from lbry.dht.error import RemoteException
from lbry.dht.protocol.distance import Distance
if typing.TYPE_CHECKING:
from lbry.dht.peer import KademliaPeer, PeerManager
Expand Down Expand Up @@ -395,7 +396,7 @@ async def add_peer(self, peer: 'KademliaPeer', probe: typing.Callable[['Kademlia
try:
await probe(to_replace)
return False
except asyncio.TimeoutError:
except (asyncio.TimeoutError, RemoteException):
log.debug("Replacing dead contact in bucket %i: %s:%i with %s:%i ", bucket_index,
to_replace.address, to_replace.udp_port, peer.address, peer.udp_port)
if to_replace in self.buckets[bucket_index]:
Expand Down

0 comments on commit 3669beb

Please # to comment.