Add 'Retries' column to Trackers tab#24388
Conversation
|
GUI:
WebUI:
|
I've resolved all review comments, changes are in 4 files total: |
|
Only I don't have a button to run the workflow? |
Shouldn't it be 0 for Working trackers? I thought that's what @stalkerok meant. |
GitHub seem to be having issues as you're not the only one who isn't seeing a workflow button.....there's issues with badges/tokens too. |
|
This happens the first time when running qBt with this PR with an existing Click
Screencast_20260526_174146.webm
|
|
Works as expected. |
|
The retry counter is stopped at 127. |
@stalkerok |
|
It looked like that. I guess there's nothing that can be done about it in qBit? |
I thought the max is 255 but in qBt it is cast into a signed variable making half of them negative. |
Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
There was a problem hiding this comment.
Pull request overview
Adds a new “Retries” column to the Trackers tab (desktop GUI + WebUI) by surfacing libtorrent’s consecutive announce failure count (fails) through backend status structs, the Web API, and both UIs.
Changes:
- Extend tracker status data (
TrackerEndpointStatus/TrackerEntryStatus) withnumFailsand populate it from libtorrent. - Expose
num_failsviaapi/v2/torrents/trackersand render/sort it in the WebUI trackers table. - Add a “Retries” column to the desktop GUI tracker list model with display + sort support.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| WebAPI_Changelog.md | Documents the addition of num_fails to the trackers API response. |
| src/webui/www/private/scripts/prop-trackers.js | Maps num_fails from API response into table row data for trackers/endpoints. |
| src/webui/www/private/scripts/dynamicTable.js | Adds the “Retries” column definition and sorting behavior for the WebUI trackers table. |
| src/webui/api/torrentscontroller.cpp | Serializes num_fails for both tracker entries and endpoint entries in torrents/trackers. |
| src/gui/trackerlist/trackerlistmodel.h | Introduces a new GUI model column (COL_RETRIES). |
| src/gui/trackerlist/trackerlistmodel.cpp | Plumbs numFails into GUI tracker model items, header, alignment, display, and sort roles. |
| src/base/bittorrent/trackerentrystatus.h | Adds numFails fields to tracker entry/endpoint status structs. |
| src/base/bittorrent/trackerentrystatus.cpp | Resets numFails in TrackerEntryStatus::clear(). |
| src/base/bittorrent/torrentimpl.cpp | Populates endpoint numFails from libtorrent and aggregates it to the tracker entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| trackerEndpointStatus.numSeeds = ltAnnounceInfo.scrape_complete; | ||
| trackerEndpointStatus.numLeeches = ltAnnounceInfo.scrape_incomplete; | ||
| trackerEndpointStatus.numDownloaded = ltAnnounceInfo.scrape_downloaded; | ||
| trackerEndpointStatus.numFails = ltAnnounceInfo.fails; |
There was a problem hiding this comment.
numFailsis always set fromltAnnounceInfo.fails, which is typically0before the tracker has ever been contacted. This makes the new Retries column show0instead of the intended “N/A” for never-contacted trackers/endpoints (as described in the PR). Consider translating the “not contacted yet” case to-1at the source.
Does it look bad if Retries column shows 0 for never-contacted trackers/endpoints? IMO, there is nothing contradictory about this.
| if (endpointStatus.numFails >= 0) | ||
| { | ||
| trackerEntryStatus.numFails = (trackerEntryStatus.numFails < 0) | ||
| ? endpointStatus.numFails | ||
| : std::min(trackerEntryStatus.numFails, endpointStatus.numFails); | ||
| } |
| COL_TIMES_DOWNLOADED, | ||
| COL_RETRIES, | ||
| COL_MSG, |
| * [#24388](https://github.com/qbittorrent/qBittorrent/pull/24388) | ||
| * `torrents/trackers` endpoint now includes `num_fails` field for tracker entries, reporting the number of consecutive failed announce attempts |

This PR adds a new "Retries" column to the Trackers tab (both desktop GUI and WebUI) that displays the number of consecutive failed announce attempts for each tracker endpoint.
Motivation
Users previously had no way to see how many times a tracker has failed to respond — they could only see the final status (Working/Not working/Tracker error/Unreachable). The raw failure count helps diagnose flaky trackers and understand retry behavior at a glance.
Implementation
libtorrent already exposes the consecutive failure count via
lt::announce_infohash::fails. It was already read inTorrentImpl::updateTrackerEntryStatus()but only used as a boolean (fails > 0) to determine tracker state — the actual count was discarded.The changes thread the value through all layers:
TrackerEndpointStatus/TrackerEntryStatus): addedint numFails = -1torrentimpl.cpp): storesltAnnounceInfo.failsper-endpoint, then aggregates to tracker-level viastd::max(consistent with hownumPeers,numSeeds, etc. are aggregated)TrackerListModel): newCOL_RETRIEScolumn, display/sort support, right-alignedtorrentscontroller.cpp): serializesnum_failsper endpoint and per trackerdynamicTable.js,prop-trackers.js): newfailscolumn with data mappingBehavior
-1as "N/A" (tracker not yet contacted)0when the tracker is working (no failures)0by libtorrent after a successful announceCloses #24013.