Bug 425971 - The Gwenview importer cannot close without bug
Summary: The Gwenview importer cannot close without bug
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: importer (show other bugs)
Version: 20.08.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-30 09:30 UTC by zed556@gmail.com
Modified: 2020-09-26 19:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.08.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zed556@gmail.com 2020-08-30 09:30:50 UTC
OBSERVED RESULT
The Gwenview importer, the window which opens when you click "download images with Gwenview" after plugging a memory card cannot close without bug. This dates back to the last major system update.

EXPECTED RESULT
Return to normal operation

SOFTWARE/OS VERSIONS
 KDE neon 5.19 User Edition
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.14.2
Comment 1 merlin 2020-09-15 13:33:47 UTC
Just to confirm. Same problem on Manjaro. Prior to latest update,no problem. Affects latest install version also (20.1)
Comment 2 zed556@gmail.com 2020-09-15 13:45:30 UTC
The problem is always here...
Comment 3 Bug Janitor Service 2020-09-25 14:09:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/15
Comment 4 zed556@gmail.com 2020-09-25 15:28:13 UTC
"since the thumbnailgenerator should always be triggered to close down when the application is quitting."
Not always ! Before the last major system update, no problem.
Comment 5 bart 2020-09-25 20:11:31 UTC
@zed556: Please read the merge request properly!
The snippet you quoted is not describing the problem, it is describing (in a lot of technical detail) why the proposed fix in that merge request is a proper solution.
Noone is arguing that the problem isn't real.  In fact, the MR describes exactly why it's going wrong and how to fix it.
Comment 6 zed556@gmail.com 2020-09-26 08:17:09 UTC
Désolé, je ne comprends pas bien l'anglais, encore moins le langage technique. Le traducteur de google ne m'a pas aidé correctement. Je suis donc bloqué pour comprendre la solution proposée dans comment 3. Merci tout de même pour vos réponses. Je télécharge avec digikam et là je n'ai plus aucun problème. Bonne journée.
Comment 7 bart 2020-09-26 13:27:58 UTC
@zed556: Je ne suis pas francophone, mais je comprends ton message toutefois. ;-)
Le plus important est que le probleme sera repare dans la version prochaine (je pense 20.08.2).
(PS: Je n'ai pas d'accents sur mon clavier qwerty. ;-) )
Comment 8 zed556@gmail.com 2020-09-26 13:44:56 UTC
Merci pour cette bonne nouvelle.
Gwenview est la meilleure visionneuse photo libre à mon avis.
Ce logiciel vaut la peine de continuer à le développer.
En plus, il peut recadrer et redimensionner les fichiers raw.
C'est formidable quand le temps nous manque d'aller bidouiller avec darktable.
Il lui manque juste le traitement par lot que je n'ai pas réussi à mettre en oeuvre avec les kipi plugins.
Dolphin fait très bien le renommage mais pas le redimensionnement.
Heureusement, Darktable et Digikam le font.

Bonne fin de semaine
Comment 9 Nate Graham 2020-09-26 19:40:21 UTC
> 20.08.2
Oui, c'est ça. :) Il faut merger...
Comment 10 bart 2020-09-26 19:41:25 UTC
Git commit d15622e1655ba7fcd33479f9677112340b2de7ff by Bart De Vries.
Committed on 26/09/2020 at 13:11.
Pushed by ngraham into branch 'release/20.08'.

Fix deadlock when closing gwenview importer

When gwenview_importer is closed after importing files, it gets into a
deadlock.  This bug was introduced in commit 4f7d35d1 by the refactoring
of thumbnailprovider and thumbnailgenerator.

The deadlock is caused by the fact that closing the application will
directly trigger a wait() in the thumbnailgenerator thread which will
wait on proper closure of this thread before allowing the application to
exit.  However, this thumbnailgenerator thread is, at that moment, in a
QWaitCondition state which is intended to wait on new thumbnails to be
generated.
As far as I can see, this is not a problem in the main gwenview
application because the deadlock will eventually be lifted by the
destruction of the thumbnailgenerator object by the chain of destructors
going from application level down to thumbnailprovider which is the
owner of this object.
In the importer the situation is a bit different.  After importing has
finished, the thumbnailpage which is the owner of thumbnailprovider
is not the current widget anymore.  It still exists in the background in
case the user presses the "Import more Documents" button.  For some
reason the destruction chain doesn't seem to properly trigger the
cancel() function of the thumbnailgenerator object/thread.

The simple solution is to call the cancel() function just before the
wait() function is called when the application emits aboutToQuit().
This is proper behavior, since the thumbnailgenerator should always be
triggered to close down when the application is quitting.

M  +1    -0    lib/thumbnailprovider/thumbnailgenerator.cpp

https://invent.kde.org/graphics/gwenview/commit/d15622e1655ba7fcd33479f9677112340b2de7ff