@@ -2966,9 +2966,8 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
29662966 return findIncompleteFiles (actualSavePath, actualDownloadPath, filePaths);
29672967 };
29682968
2969- // Start a watchdog timer to detect IO thread blockage during file search
2969+ // Start a watchdog timer to detect if the continuation never fires
29702970 QPointer<QTimer> watchdogTimer;
2971- if (needFindIncompleteFiles)
29722971 {
29732972 auto *timer = new QTimer (this );
29742973 timer->setSingleShot (true );
@@ -2977,9 +2976,8 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
29772976 m_addTorrentWatchdogTimers.remove (timer);
29782977 timer->deleteLater ();
29792978
2980- LogMsg (tr (" Warning: Torrent add file search is taking longer than expected. "
2981- " The IO thread may be blocked. Torrent: %1. "
2982- " Async calls: %2, Alerts received: %3." )
2979+ LogMsg (tr (" Warning: Torrent add continuation did not execute within timeout. "
2980+ " Torrent: %1. Async calls: %2, Alerts received: %3." )
29832981 .arg (id.toString ()
29842982 , QString::number (m_addTorrentCallCount)
29852983 , QString::number (m_addTorrentAlertReceivedCount))
@@ -2990,10 +2988,12 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
29902988 watchdogTimer = timer;
29912989 }
29922990
2993- resolveFileNames ().then (this , [this , id, loadTorrentParams = std::move (loadTorrentParams),
2991+ QFuture<FileSearchResult> fileNamesFuture = resolveFileNames ();
2992+
2993+ fileNamesFuture.then (this , [this , id, loadTorrentParams = std::move (loadTorrentParams),
29942994 watchdogTimer = std::move (watchdogTimer)](const FileSearchResult &result) mutable
29952995 {
2996- // Cancel the watchdog timer since file search completed
2996+ // Cancel the watchdog timer since continuation is running
29972997 if (watchdogTimer)
29982998 {
29992999 if (m_addTorrentWatchdogTimers.contains (watchdogTimer.data ()))
0 commit comments