MediaElch icon indicating copy to clipboard operation
MediaElch copied to clipboard

2.8.19 when program starts it stucks on Searching for movies

Open nkatsidis opened this issue 3 years ago • 2 comments

Windows 10

2.8.18 works as intended...

2.8.19 when the program starts it displays Searching for Movies and then it takes for ever to start.

Movies are on network server that runs win10 also

nkatsidis avatar Nov 03 '22 12:11 nkatsidis

Ok. There's no difference between those version code-wise. Seems to be a race condition, I think...

TODO (for me):

  • Build with Qt 6.4 and ThreadSanitizer enabled (only Qt 6.4 supports TSan)

bugwelle avatar Nov 06 '22 11:11 bugwelle

I have this issue on 2.8.18 - Windows 10, with media files on a NAS. I have 4 media drives, and sometimes the process gets stuck on disk 1, sometimes on disk 2 etc. Once it happens, even if I kill the task and try again, it won't scan properly. Sometimes works after a reboot, sometimes not.

I went back to 2.8.16 and everything works perfectly again.

ironhussar avatar Nov 11 '22 14:11 ironhussar

Note to self: TSan with Qt 6.4 requires custom glib: https://forum.qt.io/topic/140544/qt-6-4-built-with-tsan-but-how-to-add-my-own-glib-build/2

bugwelle avatar Nov 17 '22 19:11 bugwelle

Did you click on "reload" or does this happen on startup (assuming no directory is marked "auto reload")?

bugwelle avatar Nov 28 '22 17:11 bugwelle

For me it was on startup (no auto-reloading). Still using 2.8.16, which works flawlessly each time.

ironhussar avatar Nov 28 '22 17:11 ironhussar

Thanks! How many movie directories do you have (in your settings?) Also: Do you have DVD or BluRay structures?

Notes to self: re-check these commit that are not part of 2.8.16, but are part of 2.8.18:

  • 72c3d77a7f0b5423c978244afc22cd42ce484a97
  • 6c6c9f493fd07c0586b3d8beb58ea05bf769de9f

bugwelle avatar Nov 28 '22 18:11 bugwelle

I have 4 movie locations (that is, 4 separate drives in a single NAS) and 2 tv locations, by default I have the program start into the Movies section.

I don't keep disc structures on these drives, just the main titles themselves.

ironhussar avatar Nov 28 '22 21:11 ironhussar

Reproduced on my Windows system

Unbenannt

Log

2022-12-18 17:12:15.817  INFO [..\MediaElch\src\file_search\movie\MovieFileSearcher.cpp:52] | [Movies] Start reloading movies from cache
2022-12-18 17:12:15.818  INFO [..\MediaElch\src\file_search\movie\MovieDirectorySearcher.cpp:407] | [Movie] Loading entries from database for directory: "C:\\Users\\Andre\\Downloads\\Media\\Movies"
2022-12-18 17:12:15.840  INFO [..\MediaElch\src\file_search\movie\MovieDirectorySearcher.cpp:407] | [Movie] Loading entries from database for directory: "Z:\\movies"
2022-12-18 17:12:16.136 DEBUG [..\MediaElch\src\scrapers\tv_show\thetvdb\TheTvDbApi.cpp:51] | [TheTvDbApi] Received JSON web token
2022-12-18 17:12:16.136  INFO [..\MediaElch\src\globals\ScraperManager.cpp:138] | [TvScraper] Initialized: "TheTvDb"

bugwelle avatar Dec 18 '22 16:12 bugwelle

I didn't get to debug this issue but am able to reproduce the issue (every second to fifth start). I will try to look into it tomorrow or Tuesday, otherwise in the new year (due to vacation, I'm not available between Christmas and New Year's Eve). :)

bugwelle avatar Dec 18 '22 17:12 bugwelle

Easily reproducible on all systems with this patch applied:

diff --git a/src/file_search/movie/MovieFileSearcher.cpp b/src/file_search/movie/MovieFileSearcher.cpp
index c2390e40..f49549ae 100644
--- a/src/file_search/movie/MovieFileSearcher.cpp
+++ b/src/file_search/movie/MovieFileSearcher.cpp
@@ -91,6 +91,7 @@ void MovieFileSearcher::onDirectoryLoaded(MovieLoader* job)
     Q_ASSERT(job == m_currentJob);
     m_currentJob = nullptr;
     job->deleteLater();
+    QThread::sleep(2);
 
     if (m_aborted || job->isAborted()) {
         // To avoid changes to the model, _after_ the users aborts, don't add any

Found the root cause. Will be fixed ASAP.

bugwelle avatar Dec 19 '22 18:12 bugwelle

Hi, I've found the issue and fixed it in #1510. The next Nightly version will contain the fix. Thank you for reporting this bug!

bugwelle avatar Dec 19 '22 20:12 bugwelle