Bug #9164

deadlock while importing the same folder twice in parallel

Added by Igor Kuzmin over 7 years ago. Updated almost 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected Version:
git development version
hardware architecture:


1). Let's say path/to/newfilmroll contains some not yet imported pictures
2). Pass this path twice on command line to darktable: darktable path/to/newfilmroll path/to/newfilmroll
3). Only a couple of images will appear (just rectangles, no thumbs) and import will hang
4). At least sometimes after that darktable doesn't cleanly exit, you may have to kill it


#1 Updated by Jose Carlos Garcia Sogo over 7 years ago

  • % Done changed from 0 to 10
  • Priority changed from Medium to Low
  • Status changed from New to Confirmed

Well, this is somehow expected. I am not sure if this is something we should spend time on fixing.

#2 Updated by Igor Kuzmin over 7 years ago

I have to point out that specifying directory as command line argument isn't the only way to trigger this bug, just the easiest to reproduce. There are import button, D'n'D, OS X open events... I really think this should be fixed (and not just by filtering command line arguments obviously).

#3 Updated by Tobias Ellinghaus almost 7 years ago

  • System set to all
  • % Done changed from 10 to 20
  • Status changed from Confirmed to Triaged

Did anyone look into this yet?

#4 Updated by Jérémy Rosen almost 7 years ago

While testing Lua I trigger the import of the same folder dozen of times simultaneously (creating a shortcut to do it and spamming that shortcut)

I know that there is a rare case of interlocking that I have discussed with jo already, but it is very hard to trigger...

IIRC the problem is that two threads want to access two locks, one on an image and the other is the gdk lock... I don't remember exactly the details

it's very hard to trigger though, even using lua to spam...

#5 Updated by Tobias Ellinghaus almost 7 years ago

I haven't checked if this is really an issue, just thinking loud: When importing an image we add a new entry to the db, and then query it to get the auto generated id. When the same image is imported twice I could imagine that the 2nd job inserts an entry but gets the id from the 1st job which could lead to problems. If it got the correct id it would just add a duplicate.

Also available in: Atom PDF

Go to top