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
Fix and speed up health checks #7313
Conversation
8f76c31
to
4bb25e6
Compare
src/tribler/core/components/metadata_store/db/orm_bindings/torrent_state.py
Outdated
Show resolved
Hide resolved
src/tribler/core/components/torrent_checker/torrent_checker/dataclasses.py
Show resolved
Hide resolved
src/tribler/core/components/torrent_checker/torrent_checker/dataclasses.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this PR offers a good fix for the health check, but let's try to make the should_update
function simpler :)
6963c1b
to
1393a70
Compare
src/tribler/core/components/torrent_checker/torrent_checker/dataclasses.py
Outdated
Show resolved
Hide resolved
src/tribler/core/components/torrent_checker/torrent_checker/dataclasses.py
Outdated
Show resolved
Hide resolved
fd9b6a3
to
9307a1d
Compare
src/tribler/core/components/torrent_checker/torrent_checker/torrent_checker.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version of PR looks good to me.
codecov/patch
issues should be addressed (maybe not all of them, but as much as possible).
99311dc
to
5a359a5
Compare
…< operation with HealthInfo) and add default to it
…instead of TorrentState
…her); simplify health.should_update(prev_health)
5a359a5
to
f10d2dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR fixes #7287. There were several reasons for the bug:
last_check
timestamp value of 0.HealthInfo.should_update()
were also incorrect, and the logic sometimes decided to keep the previous health info and not replace it with the new health info.Also, this PR fixes the long checking time by updating the torrent health immediately. Previously, TorrentChecker aggregated all results from all possible trackers before providing the new health info. Some trackers return result almost immediately, while other wait for up to 20 seconds. Because of this, all health checks previously took around 20 seconds, and now in many cases, they are updated almost immediately and then corrected with results from additional trackers if necessary.