View Single Post
Old 11-11-2014, 02:13 PM   #107
ShellShock
Wizard
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 1,178
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
Thanks chaley, that is very helpful. I have 3 hypothesis:
  1. Contention for the remote database file on the device; based on your experience this is now top of my list. I have previously tried allowing for this using two different methods of requesting an exclusive lock on the remote file via the interface library (libimobiledevice). However, I have no idea if this locking request is obeyed on the device; I suspect not because in testing the request always succeeds, whereas I would expect it to sometimes fail (or block) when the device is under load and writing to the file. As you suggest, we probably need Marvin to make a copy of the database, or maybe expose a mutex that both ends can use to synchronise access to the fie.
  2. Contention for the local database file on the PC. Although there are several Calibre threads which appear in the logs, I can't see any real evidence that they are in contention for the file.
  3. A bug in the libimobiledevice code that downloads the remote database file. No evidence so far.

I am going to pursue 1 for now.
ShellShock is offline   Reply With Quote