Merge pull request #2596 from lbryio/dont-log-incompatible-peer-error

don't log tracebacks for old peers failing to handle findValue requests
This commit is contained in:
Jack Robison 2019-11-01 13:13:38 -04:00 committed by GitHub
commit faf9449107
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -664,6 +664,9 @@ class KademliaProtocol(DatagramProtocol):
log.error("Unexpected response: %s" % err) log.error("Unexpected response: %s" % err)
return peer.node_id, False return peer.node_id, False
except RemoteException as err: except RemoteException as err:
if 'findValue() takes exactly 2 arguments (5 given)' in str(err):
log.debug("peer %s:%i is running an incompatible version of lbrynet", peer.address, peer.udp_port)
return peer.node_id, False
if 'Invalid token' not in str(err): if 'Invalid token' not in str(err):
log.exception("Unexpected error while storing blob_hash") log.exception("Unexpected error while storing blob_hash")
return peer.node_id, False return peer.node_id, False

View file

@ -434,6 +434,8 @@ class ManagedStream:
we_have = [ we_have = [
blob_hash for blob_hash in needed if blob_hash in self.blob_manager.completed_blob_hashes blob_hash for blob_hash in needed if blob_hash in self.blob_manager.completed_blob_hashes
] ]
log.info("we have %i/%i needed blobs needed by reflector for lbry://%s#%s", len(we_have), len(needed),
self.claim_name, self.claim_id)
for blob_hash in we_have: for blob_hash in we_have:
await protocol.send_blob(blob_hash) await protocol.send_blob(blob_hash)
sent.append(blob_hash) sent.append(blob_hash)

View file

@ -98,8 +98,6 @@ class StreamReflectorClient(asyncio.Protocol):
self.reflected_blobs.append(sd_blob.blob_hash) self.reflected_blobs.append(sd_blob.blob_hash)
else: else:
log.warning("Reflector failed to receive descriptor %s", sd_blob.blob_hash[:8]) log.warning("Reflector failed to receive descriptor %s", sd_blob.blob_hash[:8])
if needed:
log.info("Reflector needs %i blobs for %s", len(needed), sd_blob.blob_hash[:8])
return sent_sd, needed return sent_sd, needed
async def send_blob(self, blob_hash: str): async def send_blob(self, blob_hash: str):