Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elaborate on streaming API and strategy #6293

Conversation

AllSeeingEyeTolledEweSew
Copy link
Contributor

I've been reading a lot trying to get a handle on torrent streaming, how libtorrent supports it and how its support should be used.

I updated streaming.rst with my findings, both to validate them and to help anyone else in this space (it seems there are a couple people working actively on streaming right now).

Please let me know if anything's inaccurate or incomplete.

In particular, I'm boldly assuming the best growth-friendly API usage is that users should call set_piece_deadline() for a whole file, and use other mechanisms to dynamically constrain the time-critical set. I lean this way because I can think of some other such mechanisms to try, but I doubt I've thought of everything. Please let me know if you have different ideas.

do with the "leftover" bandwidth once the critical window is fulfilled. One idea
is to use classic rarest-first picking to download the rest of the torrent, as
this can mitigate the problems of sequential downloading, and keeps request
queues full.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's described as a "one idea is to" here is in fact what libtorrent does. I'm worried that phrasing it like this may suggest to the reader that this is not necessarily what libtorrent does.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is clarified further down

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using a first-principles approach to documenting streaming logic and functions, because it seems to be a cutting-edge area. I think documenting our basis of understanding is crucial. In contrast, we don't need to document why libtorrent uses rarest-first picking, because there's plenty of information available on the topic.

I believe the lack of clarity has left users confused, and having wrong expectations of libtorrent.

Recent user discussions end up disregarding time-critical logic in favor of sequential_download ([1], [2]). Since time-critical logic is intended to be a better version of sequential_download, I conclude either these users don't understand it, or couldn't figure out how to make set_piece_deadline work in a context that lacks well-defined deadlines.

Code examples I can find in the wild which use set_piece_deadline ([1], [2], [3]) seem to use it wrong. Judging by that code, I suspect there's a prevailing belief that the intent of set_piece_deadline() is to download a piece within the next N milliseconds. Said another way, I think a lot of users are confused between deadline and timeout.

I think it would be really helpful to link to a project that uses set_piece_deadline in the intended way, where deadlines are well-defined, e.g. in a video player. I couldn't find any though.

@stale
Copy link

stale bot commented Oct 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 9, 2021
@AllSeeingEyeTolledEweSew
Copy link
Contributor Author

Unstale. I'd still like to figure this out.

@stale stale bot removed the stale label Oct 9, 2021
@master255

This comment has been minimized.

@stale
Copy link

stale bot commented Jan 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants