@JimmXinu: You can get re-entrant violations if something is holding a connection to the sqlite db open and then does something to modify that connection. This should be mostly impossible if you are using the standard calibre db APIs since they wrap database access. However, since plugins can in theory do pretty much anything, there are no guarantees.
It cant be a threading violation since the proceed dialog ensures its callbacks are always called on the main thread. And this is easy to confirm by simply inserting a print to print the thread id in do_ask_question() in proceed.py. This function is called via a Queued signal, which Qt guarantees are only delivered on the main thread (the one with the event loop running). Therefore it must be a re-entrancy violation. It could be that there is some other thread in the program holding the db open other than the main thread. But in vanilla calibre that is only the db backup thread and that works via the calibre db api which uses a RWLock to ensure only a single thread ever does any write operations on a db at a particular time.
I doubt that commit will help the issue, I just made it to make the code cleaner since I was reading it to help with your issue.
|