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

DHT iterator continues after consumer breaks out of it

Open shyba opened this issue 4 years ago • 0 comments

This script reproduces one specific case (but I don't know which one the codebase hits): https://gist.github.com/shyba/a22789f1de99506bcea8bb85dbcf78f9

When running with debug statements, you will notice the iterative find value probes are still going. If you reduce the sleep time or keep it going, it will flood.

Something happens somewhere when you exit the iterator using a break statement where it doesn't get closed properly, leaving the tasks running. This happens across the codebase somewhere, which causes some leftover tasks on shutdown. Just annoying but would be nice to fix since stopping the search can save resources too.

shyba avatar Dec 03 '21 21:12 shyba