View Single Post
Old 09-18-2020, 04:09 PM   #425
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,035
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by JimmXinu View Post
FYI, I think that my DB update issue may well have been caused by my threading issue.

<ThreadingViolationError>

...
I have new information on this.

I was trying to duplicate it and was finally able to by assigning a couple hot keys to add/remove from Reading List and just hammering them for a while.

I got the same error as before a couple times, but a more couple times now, instead of a ThreadingViolationError in plugin code, this spit out in the debug output:
Code:
Traceback (most recent call last):
  File "C:\Users\retief\Desktop\nook\calibre\src\calibre\db\backup.py", line 63, in do_one
  File "C:\Users\retief\Desktop\nook\calibre\src\calibre\db\cache.py", line 63, in call_func_with_lock
  File "C:\Users\retief\Desktop\nook\calibre\src\calibre\db\cache.py", line 1102, in check_dirtied_annotations
  File "C:\Users\retief\Desktop\nook\calibre\src\calibre\db\backend.py", line 1940, in dirty_books_with_dirtied_annotations
apsw.ThreadingViolationError: You are trying to use the same object concurrently in two threads or re-entrantly within the same thread which is not allowed.
Is there a background thread somewhere that's auto-updating annotations? I did not have server running at the time.

ADDED: I'm running v4.99.16 win10 64bit binaries from source as of 9ec29bb5485b56c7024edd9648ec07fadb7ff28c

ADDED: backup.py is specifically for class MetadataBackup(Thread), so yeah, it looks like there's a BG thread running that can conflict with other DB access.

What happens with backend.py:124 vs backend.py:1940 both `with conn` when conn() is a property function? I don't know Python with well enough to know if that's a problem.

Last edited by JimmXinu; 09-18-2020 at 04:28 PM. Reason: class MetadataBackup(Thread)
JimmXinu is offline