Skip to content

Commit

Permalink
log bottom out of peer search in debug, show short key id for find value
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Feb 8, 2022
1 parent 64ef302 commit 87ec7ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lbry/dht/protocol/iterative_find.py
Expand Up @@ -351,9 +351,10 @@ def check_result_ready(self, response: FindNodeResponse):
if self.are_k_closest_peers_ready:
self.put_result(self.active, True)
elif self.bottom_out_count >= self.bottom_out_limit or self.iteration_count >= self.bottom_out_limit:
log.info("peer search bottomed out.")
log.debug("peer search bottomed out.")
self.put_result(self.active, True)


class IterativeValueFinder(IterativeFinder):
def __init__(self, loop: asyncio.AbstractEventLoop, peer_manager: 'PeerManager',
routing_table: 'TreeRoutingTable', protocol: 'KademliaProtocol', key: bytes,
Expand Down Expand Up @@ -420,10 +421,10 @@ def check_result_ready(self, response: FindValueResponse):
elif self.is_closest_peer_ready:
self.bottom_out_count += 1
if self.are_k_closest_peers_ready:
log.info("blob peer search finished.")
log.info("blob peer search finished for %s", self.key.hex()[:8])
self.iteration_queue.put_nowait(None)
elif self.bottom_out_count >= self.bottom_out_limit:
log.info("blob peer search bottomed out")
log.info("blob peer search bottomed out for %s", self.key.hex()[:8])
self.iteration_queue.put_nowait(None)

def get_initial_result(self) -> typing.List['KademliaPeer']:
Expand Down

0 comments on commit 87ec7ac

Please sign in to comment.