-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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] instant.io has trouble downloading from libtorrent seeds #5831
Comments
It would be helpful if you enabled logging (torrent and peer logging specifically) in the alert_mask, and logged all alerts to a file. If you no peer actually ends up successfully requesting data from you, there shouldn't be too much in the log. But there may be some hint of the peer trying to connect. @paullouisageneau do you have any more ideas? does libdatachannel have a separate log? |
Thank you for the quick reply!
Apologies, how does one do that exactly? With |
Do you at least see more alerts than previously? |
Yes, like that.
Hmm, no. Looks about the same number of alerts. |
This could have different causes, but the most probable is either some issue with establishing WebRTC connections or a compatibility issue with the WebTorrent client on Instant.io. There is a debug flag to output the logs of libdatachannel, you could try enabling it: libtorrent/src/rtc_signaling.cpp Line 35 in eb62b96
I'll do some tests on my side when I get the time. |
I have investigated why this happens, and filed a new issue: #5848
There are indeed a lot more messages with the alert mask set. I searched for the IP address of the machine running the web browser with instant.io, and it only occurs once, on a |
Yes, this confirms the WebRTC connection couldn't be established. Could you please link the entire log? |
Ok, here is the complete log of a failed attempt to download a file using |
Thanks for the log! For now I see three potential problems:
The answer sent through the tracker seems valid, so this might come from the lack of keepalive on the WebSocket. I'll investigate further. |
The problem seems to come from the trackers instant.io uses: The issue could have been an invalid answer format from libtorrent. I tried deploying the same tracker locally than on So I would conclude the tracker is just unreliable. I added a keepalive in #5882, it seems to help a bit but it still fails regularly. A way to mitigate the issue could be to randomize the WebSocket tracker retry interval to break the non-working pattern, but it isn't very satisfying as it won't connect quick enough. |
Thank you for looking into this. If it's okay, I have a few more questions.
|
The connection to the tracker is lost randomly because the tracker seems to be overloaded anyway. It is still regularly lost in the browser but it seems less frequent. I still don't know why the connection to libtorrent is closed but there are two possibilities:
There is no possibility of using the DHT with WebTorrent. That's a limitation of WebRTC.
I'll contact the tracker maintainers to see if they have more information. Sadly I don't know of other public WebTorrent trackers. If you want to host your own tracker, openwebtorrent-tracker (C++) seems to work fine, otherwise you could deploy the reference tracker implementation (node.js, less performant). There is also wt-tracker but I haven't tried it. |
You can try wss://tracker.sloppyta.co |
It seems to me that the WebTorrent client also regularly disconnects after having requested a bunch of pieces, and then reconnects again to resume requesting pieces. I haven't looked any closer into whether this is deliberate or caused by some failure yet. I'll try to take a closer look. |
I set up a test torrent, seeding a web-torrent compatible torrent, here: magnet:?xt=urn:btih:8c3c639e90b4d06bb59c746eb569f4b2dbfa2000&xt=urn:btmh:1220db736898b9fd6799695f9830d333c14e8105f237b437a6c1ca0d42fb604630b1&dn=webtorrent-test&tr=wss%3a%2f%2ftest.libtorrent.org This is a v1,v2 hybrid torrent. I also set up a tracker (openwebtorrent-tracker) at |
it seems openwebtorrent-tracker terminates with |
I believe the issue is that WebTorrent does not support the
This repeats quite a few times (as one would expect). However, if WebTorrent ignores this message, it still thinks it has outstanding piece requests, and libtorrent doesn't. That would explain the stall. Both parties thinks the ball is in the other's court. If I set the Apart from raising the |
in fact, WebTorrent does not advertize support for the 2008 FAST extension, so there is in fact no |
I filed this: webtorrent/webtorrent#1995 |
@arvidn Great, thanks for taking the time to investigate that issue! |
Thank you all guys for working hard on bringing webtorrent to libtorrent! |
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. |
@arvidn is this sill WIP? I assume you're waiting for webtorrent to implement FAST? |
I've mitigated the issue to some extent by increasing the default number of queued incoming requests. But the original BitTorrent protocol doesn't support any form of back pressure, so I can't ask webtorrent to back off unless it implements the FAST extensions (specifically, REJECT_REQUEST) It's working better, but still with intermittent slow-downs when it overruns the request queue limit. |
is there any chance for this to make it into a major release so libtorrent based BT clients can support WRTC, or is there something that's still missing/needs work? |
@paullouisageneau is this still an issue now that webtorrent/webtorrent#2243 is implemented? |
@ThaUnknown No, the issue should be solved by webtorrent/webtorrent#2243 |
is there anything else on the roadmap for BT over WebRTC left? |
Feature-wise, I don't think there is, however more testing would be welcome. I've just open a PR #6826 to update libdatachannel. |
Hi! Thank you for this project. I discovered the following issue. When libtorrent is built with
-Dwebtorrent=on
, it can successfully and quickly download from magnet links created on instant.io. However, it doesn't work very well in reverse:In the last case, instant.io either forever stays at "Downloading torrent", or succeeds after a long time (over 10 minutes). Perhaps there is a compatibility issue?
Here is the test program for seeding:
Using libtorrent d5b27ee on Linux.
The text was updated successfully, but these errors were encountered: