lbry-sdk icon indicating copy to clipboard operation
lbry-sdk copied to clipboard

Improve DHT log handling

Open shyba opened this issue 4 years ago • 2 comments

It is being logged like:

2021-11-17 15:56:47,952 WARNING lbry.dht.protocol.protocol:539: Error sending 'b'findNode'' to x.y.z.w:4444
Args: [b'\xd5\xdfFr\xbd\x06\xff\xe0\xc9\xf0?JU=\xcf\xdb\x01\xba\x95<\xdbk\x93<CQ\xc2\x1e\x82\xf8i\x00\xc9%aY\x8b\xabH`\xd6F\x10(\xff\xd5;W', {b'protocolVersion': 1}]
Raised: <class 'AssertionError'>(('d9df4672', 'd9df4672'))

This should be a smaller log line with the details into .debug (should it be a warning at all?)

shyba avatar Nov 17 '21 17:11 shyba

also: improve the other side of it... Sending a raw AssertionError back isn't helpful

shyba avatar Nov 17 '21 17:11 shyba

I believe the exception contents line up with this assert: https://github.com/lbryio/lbry-sdk/blob/b8867cd18cf32e61af52abe09664a8dd9e7d6af1/lbry/dht/protocol/protocol.py#L450

However, the sender has this assert: https://github.com/moodyjon/lbry-sdk/blob/ebfca6bc6f21cc651b14c95683e10f8c1a42d208/lbry/dht/protocol/protocol.py#L651

Neither assert is particularly new. So could it be that the message was observed in a mixed environment? Where some nodes were running code in debug == False mode?

moodyjon avatar Apr 14 '22 16:04 moodyjon