BiglyBT icon indicating copy to clipboard operation
BiglyBT copied to clipboard

Sequential Download Bug

Open NotMyGovtName opened this issue 7 years ago • 9 comments

When initially adding a torrent and checking the "Sequential Download" box, the torrent still downloads pieces in random order.

Only after clicking on the torrent, unchecking the box and then clicking on it again and re-checking the box does it download the pieces in sequence.

Windows 7 Ultimate BiglyBT Version Number - 2.0.0.0

NotMyGovtName avatar Jun 29 '19 20:06 NotMyGovtName

Not seeing this myself, torrent downloads sequentially if selected on add dialog (don't think there's been any change to sequential d/l between 2.0.0.0 and lastest beta I'm using2.0.0.1_B13).

PrototypeZero avatar Jul 03 '19 21:07 PrototypeZero

@parg I can affirm, this does happen, though it isn't very common but not rare either. When it does happen, some really strange behaviors can transpire;

The following image shows a torrent which after completing the first file (which was not even the actual first file), "sequentially", started to ignore the setting. Thus the many random pieces shown in the files. Then after a manual start/stop cycle, started downloading two; first and third file sequentially... Only finishing the real first file, did it stop downloading two at once.

[image removed]

Well this maddening behavior is rarer still and usually it either sequentially downloads or ignores the setting. But it does demonstrate how error prone the logic behind is.

I am on Beta 31, W10 1903 x64.

brazenvoid avatar Nov 26 '19 04:11 brazenvoid

Just as a general comment, sequential downloading (of the entire download) should be persisted across download/client stop/starts. Individual settings (right-clicking on a file/piece and explicitly selecting sequential behaviour) will interfere with this proces. Automatic settings regarding 'auto sequential for selected file extensions' also do so.

Sequential downloading is achieved at the piece level by setting the piece priorities so that the desired sequence is preferred. Various other things also mess with priorities (e.g. attempting to 'stream while downloading').

When things go wrong perhaps you can take a look at the 'pieces' ot 'piece map' sub-tabs and check out the piece priorities. Sequential pieces should be allocated a priority of 100,000+

parg avatar Nov 26 '19 11:11 parg

Well I started another torrent which was marked as sequential download when it was added to the queue a few days back. It exhibits the same issue again:

Annotation 2019-11-28 060115

The pieces being downloaded have priorities all under 100 and I couldn't find a way to get priorities of pieces currently not downloading. Also not through the piece map.

brazenvoid avatar Nov 28 '19 01:11 brazenvoid

You can hover over a piece in the Piece Map and the top line of text will update with information including priority ("pri=nnn")

The header also shows the current sequential operation, "seq=", indicating whether sequential mode is active and if so from which piece and in which direction. So

seq=0+ means sequential from the start to the end of the download

parg avatar Nov 28 '19 09:11 parg

So started another torrent with same issue. This time it is downloading many files sequentially... All pieces being downloaded have priority ranging in 100,000- 225,000. I mean why would it download some piece with 100k priority when there is already some with 225k priority pieces readily available... Start/Stop does not make it change its behavior, that's a first though...

Annotation 2019-12-06 083445

brazenvoid avatar Dec 06 '19 03:12 brazenvoid

Do you have files with different download priorities? Take a look at

https://github.com/BiglySoftware/BiglyBT/blob/master/core/src/com/biglybt/core/peermanager/piecepicker/impl/PiecePickerImpl.java

method "computeBasePriorities", if you're interested.

There's a lot going on... For example, if you are connected to a peer that currently only has pieces A, B and C then BiglyBT will request the highest priority piece from amongst A, B, C (obviously, it can't request any others)

parg avatar Dec 06 '19 08:12 parg

No I don't assign priorities to individual files. Running torrents (globally) in sequential mode is also a recent thing for me as I have finally ran out of all the junk I had amassed. Also I use private trackers, so all torrents even if they have few seeds, are still extremely fast. The above example torrent has 200+.

Now I do understand more about the workings of priorities in your software and also to an extent assume the logic behind, through the code you presented.

What I seem to not understand is why will it abandon the sequential download behavior mid-work. Fine you don't have the next piece skip to the next piece in the same file... If it is slow to get, still get it, don't skip it!

The behavior that it starts sequential download of multiple files as seen in my previous post, is also because there is no limitation to force allocation of pieces file by file. But actually it still considers all the pieces in the torrent by priority. Though I understand that this can increase download speed but that defeats the purpose of sequential download.

Here I am waiting for it to complete the next file so I can do something with it, I check after minutes and the app has ran off to places unknown... With sequential download, I expect files getting done sequentially so I can deal with them in order. I don't care how slow they are downloaded.

brazenvoid avatar Dec 06 '19 10:12 brazenvoid

I found a bug that is kicking a download out of sequential mode when the first file completes, fix will be in beta B39.

parg avatar Dec 06 '19 12:12 parg