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

WebTorrent should persist the DHT table entries #5528

Open
feross opened this issue Aug 3, 2019 · 0 comments
Open

WebTorrent should persist the DHT table entries #5528

feross opened this issue Aug 3, 2019 · 0 comments
Assignees
Labels
Projects

Comments

@feross
Copy link

feross commented Aug 3, 2019

Description

Certain torrents rely exclusively on the DHT to find peers, and have no functioning tracker servers. Here's an example torrent (https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-10.0.0-amd64-DVD-1.iso.torrent). It has a single tracker server (http://bttracker.debian.org:6969/announce) that seems to be offline.

Torrents that rely exclusively on the DHT are not a problem, except that Brave is currently not persisting the DHT table to disk between instantiations of the WebTorrent client (i.e. new WebTorrent()) This means that the DHT bootstrap nodes must be contacted each time the WebTorrent client is re-created, as the previous table entries are discarded when the client is destroyed (which happens where there are no more active torrent tabs).

The bootstrap nodes typically refuse to respond to clients who repeatedly contact them, as their intended purpose is to bootstrap new clients into the network by returning some ip:ports of other clients in the network, after which the bootstrap node should never need to be contacted again (unless all ip:ports that a client is aware of have gone offline).

Long story short, if the bootstrap nodes refuse to reply, then a torrent that has no working tracker servers will just refuse to start downloading because no peers can be found.

Steps to Reproduce

  1. Visit the link https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-10.0.0-amd64-DVD-1.iso.torrent
  2. Start and stop the torrent download repeatedly (say 5 times)
  3. After this, start the torrent and note that it will refuse to start downloading
  4. If it is working, then it's possible that the tracker server has come back online. Confirm that contacting the tracker server (http://bttracker.debian.org:6969/announce) fails by checking chrome://inspect/#extensions for a network error to this URL.

Actual result:

Torrent with no working tracker server fails to download after repeatedly started and stopped.

Expected result:

Torrent with no working tracker server should download with no issues after repeatedly started and stopped.

Reproduces how often:

Intermittent issue

Brave version (brave://version info)

All versions.

Miscellaneous Information:

$ npx parse-torrent https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-10.0.0-amd64-DVD-1.iso.torrent
{
  "name": "debian-10.0.0-amd64-DVD-1.iso",
  "announce": [
    "http://bttracker.debian.org:6969/announce"
  ],
  "infoHash": "6608c463a9a158d065b167b351d2f738d611ba96",
  "created": "2019-07-06T11:29:01.000Z",
  "comment": "\"Debian CD from cdimage.debian.org\"",
  "urlList": [],
  "files": [
    {
      "path": "debian-10.0.0-amd64-DVD-1.iso",
      "name": "debian-10.0.0-amd64-DVD-1.iso",
      "length": 3841982464,
      "offset": 0
    }
  ],
  "length": 3841982464,
  "pieceLength": 1048576,
  "lastPieceLength": 1048576,
  "pieces": [
...
@feross feross added the feature/webtorrent Label for webtorrent related issues label Aug 3, 2019
@feross feross self-assigned this Aug 3, 2019
@feross feross added this to To do in WebTorrent via automation Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
WebTorrent
  
To do
Development

No branches or pull requests

1 participant