Bug 406594

Summary: Interface becomes irresponsive for a while after editing metadata in search panel.
Product: [Applications] digikam Reporter: MarcP <iwannaberich>
Component: Searches-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: iwannaberich, metzpinguin
Priority: NOR    
Version First Reported In: 6.1.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.2.0
Sentry Crash Report:

Description MarcP 2019-04-16 12:13:29 UTC
SUMMARY
When you are in Search view, with a relatively large amount of items listed (like tens of thousands), and you edit metadata on some, the metadata is saved, and then Digikam's interface does not respond for a while, sometimes even minutes. I even tried that in a fast computer with a local database and library, so I don't think it has to do with network speed or latency.

STEPS TO REPRODUCE
1. List a large numbers in search view (e.g. search for ".").
2. Add a tag to a file.
3. Wait until digikam is responsive again.

OBSERVED RESULT
It takes a while, from tens of seconds to a few minutes until digikam can be used again.

EXPECTED RESULT
The total time should not be higher than the time taken to perform the search plus the time needed to save and re-read the metadata from the files.

SOFTWARE/OS VERSIONS
Ubuntu 18.04 with Gnome and digikam-6.1.0-git-20190404T203330-qtwebkit-x86-64.appimage (although this happened in previous versions too)
Comment 1 Maik Qualmann 2019-04-17 06:39:20 UTC
I can not reproduce a problem with setting tags in such a view. But when selecting the images, the description tab is open. Example: search result gives you about 25000 items, so if I try to select them all with an open description tab, it will take:
SQLite: 7 seconds
MySQL: 4:40 minutes

We have to read the status of all images (title, comments, templates, color label, pick label, rating, tags) to set the status of the description tab correctly. Many thousands of SQL queries are needed. A first test patch now reduces this to 30 seconds under MySQL. Can you confirm that the GUI freezes when selecting images?

Maik
Comment 2 Maik Qualmann 2019-04-17 10:41:07 UTC
Git commit a6e93d0ab64fc78c01e42e85f1a43baf71188507 by Maik Qualmann.
Committed on 17/04/2019 at 10:40.
Pushed by mqualmann into branch 'master'.

check faster the disjoint Metadata from items

M  +50   -10   core/libs/properties/captions/disjointmetadata.cpp
M  +14   -0    core/libs/properties/captions/itemdescedittab.cpp

https://commits.kde.org/digikam/a6e93d0ab64fc78c01e42e85f1a43baf71188507
Comment 3 MarcP 2019-04-17 11:20:50 UTC
I forgot to mention. While I wait for digikam to become responsive, it constantly throws that "Digikam is not responding" with the Force quit option in it. (like this one: http://www.buzzmeweb.com/images/topic-Is%20Your%20Ubuntu%20Not%20Working%20or%20Responding.png) 

While that message is displayed, the mouse stops responding to clicks in all other applications in the computer (the keyboard works, though). That happens at least in Ubuntu 18.04 with Gnome, but I can't tell whether it's the operating system's fault or digikam's.

In my case, I use a SQLite db stored locally in an SSD (so it should be faster than MySQL), and the time it takes to become responsive again is far superior to the time needed for digikam to load the search in the first place.

The pictures themselves are stored in a NAS mounted in a folder through sshfs. Maybe sshfs can't handle all that traffic in a sustained manner and freezes temporarily? But in theory, just performing the search should only use the information local database and not the remote pictures. I don't know.
Comment 4 MarcP 2019-05-08 21:11:15 UTC
I've been using digikam for the last few days, and this problem is no longer present. Changes made when pictures are listed in the Search panel are applied immediately as would be in any other panel.

This is valid at least for digikam-6.2.0-git-20190502T153144-qtwebkit-x86-64.

If it's up to me, this bug report can be closed.
Comment 5 Maik Qualmann 2019-05-09 06:00:47 UTC
Thanks, I close it, if necessary open again.

Maik