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

Remove torrent checking for channel torrents #7882

Merged

Conversation

xoriole
Copy link
Contributor

@xoriole xoriole commented Feb 5, 2024

This PR removed the torrent checks on torrents of the user channel. Since channels are removed, it does not make sense to keep these checks anymore. Besides, for a large metadata database (~5GB), the query to select torrent from user channel is pretty slow (161.362 seconds). See log below.

[tribler-core PID:10196] 2024-02-02 23:21:52,505 - WARNING - tribler.core.utilities.pony_utils(268) - Long db_session detected.
Session info:
    Thread: 'MainThread'
    db_session duration: 161.362 seconds
    db_session waited for the exclusive lock for 0.000 seconds
    db_session held exclusive lock for 0.000 seconds
The db_session stack:
  File "C:\Users\tribler\PycharmProjects\tribler\venv8\lib\site-packages\ipv8\taskmanager.py", line 25, in interval_runner
    await task(*args)
  File "C:\Users\tribler\PycharmProjects\tribler\src\tribler\core\components\torrent_checker\torrent_checker\torrent_checker.py", line 266, in check_torrents_in_user_channel
    selected_torrents = self.torrents_to_check_in_user_channel()

Queries statistics for the current db_session:
1 query executed in a total of 161.358 seconds;
The slowest query (161.358 seconds) is:
    SELECT "g"."rowid", "g"."infohash", "g"."size", "g"."torrent_date", "g"."tracker_info", "g"."title", "g"."tags", "g"."metadata_type", "g"."reserved_flags", "g"."origin_id", "g"."public_key", "g"."id_", "g"."timestamp", "g"."signature", "g"."added_on", "g"."status", "g"."xxx", "g"."health", "g"."tag_processor_version"
    FROM "ChannelNode" "g", "TorrentState" "torrentstate"
    WHERE "g"."metadata_type" IN (300)
      AND "g"."public_key" = ?
      AND "g"."metadata_type" = ?
      AND "torrentstate"."last_check" < ?
      AND "g"."health" = "torrentstate"."rowid"
    ORDER BY "torrentstate"."last_check"
    LIMIT 5
    ```

@xoriole xoriole marked this pull request as ready for review February 5, 2024 11:37
@xoriole xoriole requested a review from a team as a code owner February 5, 2024 11:37
@xoriole xoriole requested review from egbertbouman and removed request for a team February 5, 2024 11:37
@xoriole xoriole force-pushed the fix/remove-torrent-check-in-user-channel branch from 07b2d3d to 7c16a50 Compare February 5, 2024 14:41
@xoriole xoriole merged commit 2039f9e into Tribler:main Feb 5, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants