Skip to content

Download overhaul

David Vorick requested to merge download-overhaul into master

I have replaced the old download code with some newer, fancier download code. It should be faster, less error prone, and easier to understand. It also has more flexibility for adding features in the future. And it uses the same memory pool as the renter.

I haven't done any live-testing with this code yet, but it's passing the full test suite from our previous code.

I also haven't yet gone through the full PR with a fine-toothed comb, though I kept a long checklist of things to do while I was working, and I think I've gotten pretty much everything properly organized.

I think that I made a slight compromise to the repair code when I changed the memory model. The new memory model assumes that you can block waiting for memory and not need to listen on a channel for new stuff, but the repair code actually does stutter if it's stuck waiting for memory and new repair jobs are coming in. If this proves to be problematic, we'll have to switch the repair heap over to the same mutli-threaded-queue-ing system that the download heap has. This system is the better system, so it's a change we should make at some point anyway.

Merge request reports