Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

First torrent after booting does not start #22

Closed
qstokkink opened this issue Apr 19, 2024 · 4 comments · Fixed by #24
Closed

First torrent after booting does not start #22

qstokkink opened this issue Apr 19, 2024 · 4 comments · Fixed by #24
Labels
bug Something isn't working

Comments

@qstokkink
Copy link
Owner

qstokkink commented Apr 19, 2024

When starting a fresh Tribler instance, searching for a torrent and subsequently downloading it, the downloaded torrent does not start.

  • This does not happen when starting a download using a .torrent file.
  • This does not happen when allowing the metadata to be fully retrieved before starting the download.

Specifically, it keeps cycling through peers endlessly.

The workaround for this is to start and stop the torrent.

screenshot

@qstokkink qstokkink added the bug Something isn't working label Apr 19, 2024
@qstokkink
Copy link
Owner Author

Information from the debug screen:

For the stuck torrent. Libtorrent reports ses.num_upload_only_torrents equal to 1. After starting and stopping the torrent, the value is set to 0.

@qstokkink

This comment was marked as off-topic.

@qstokkink
Copy link
Owner Author

I noticed a Timeout waiting for libtorrent DHT getting enough peers log message.

Commenting out these lines, fixes the issue:

if self.dht_readiness_timeout > 0 and self.dht_ready_task is not None:
try:
await wait_for(shield(self.dht_ready_task), timeout=self.dht_readiness_timeout)
except asyncio.TimeoutError:
self._logger.warning("Timeout waiting for libtorrent DHT getting enough peers")

@qstokkink
Copy link
Owner Author

After some very extensive debugging (thanks @xoriole and @egbertbouman) I found the fix. Replace:

_ = self.register_anonymous_task('AddTorrent', self._async_add_torrent, ltsession, infohash, atp,
ignore=(Exception,))

with

_ = self.replace_task(f"AddTorrent{infohash}", self._async_add_torrent, ltsession, infohash, atp,
                                  ignore=(Exception,))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant