Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-01-2024, 10:25 PM   #16
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Should be easy enough to trace

put a

traceback.print_stack()

in the __init__ method of Cache in db/cache.py

See what is allocating the db.
kovidgoyal is offline   Reply With Quote
Old 01-02-2024, 03:50 AM   #17
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by kovidgoyal View Post
Should be easy enough to trace

put a

traceback.print_stack()

in the __init__ method of Cache in db/cache.py

See what is allocating the db.
Thank you, I'll do it.
Terisa de morgan is offline   Reply With Quote
Advert
Old 01-02-2024, 03:52 AM   #18
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
Thank you for taking the time to continue tracing this.
No need to thank you, it has been a way to entertain myself as I have to stay at home with a cold

Quote:
Originally Posted by chaley View Post
What those traces say is that python garbage collection is collecting (deleting) the current database, thus closing it or a copy of it.

In other words, I think that something is opening the database of the current library or creating a copy (copy.deepcopy()) of an open instance variable, saving it as a local variable. When GC (garbage collection) is called that local copy is closed. There are timing problems here. The local variable might not be collected in some situations.

The only way I can see to verify this is to remove the plugins one at a time to see if the problem goes away. I would start with Action Chains, as I checked SaveCompositeColumns and it doesn't reopen or make a copy of the DB. If the plugin is found then we can look for why the variable that GC collects is created.

I hope Kovid notices this thread. He will probably have ideas on why it is happening and how to find it.
I've already removed a lot, including what you mention, and same issue. I think I'll follow Kovid's suggestion for checking this.
Terisa de morgan is offline   Reply With Quote
Old 01-02-2024, 05:45 AM   #19
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by kovidgoyal View Post
Should be easy enough to trace

put a

traceback.print_stack()

in the __init__ method of Cache in db/cache.py

See what is allocating the db.
No information added, different __init__ but not one near the request that is resetting the function:

Spoiler:
[' File "runpy.py", line 198, in _run_module_as_main\n', ' File "runpy.py", line 88, in _run_code\n', ' File "site.py", line 95, in <module>\n', ' File "site.py", line 90, in main\n', ' File "site.py", line 50, in run_entry_point\n', ' File "C:\\git\\calibre\\src\\calibre\\debug.py", line 231, in main\n', ' File "C:\\git\\calibre\\src\\calibre\\gui_launch.py ", line 73, in calibre\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 552, in main\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 564, in run_main\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 402, in run_gui\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 418, in run_gui_\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 376, in initialize\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 355, in initialize_db\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 312, in initialize_db_stage2\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\main.py ", line 260, in start_gui\n', ' File "C:\\git\\calibre\\src\\calibre\\gui2\\ui.py", line 446, in post_initialize_actions\n', ' File "C:\\git\\calibre\\src\\calibre\\db\\cache.py" , line 2802, in __del__\n', ' File "C:\\git\\calibre\\src\\calibre\\db\\cache.py" , line 2840, in close\n', ' File "C:\\git\\calibre\\src\\calibre\\db\\backend.p y", line 1363, in close\n', ' File "C:\\git\\calibre\\src\\calibre\\utils\\formatter_ functions.py", line 2762, in unload_user_template_functions\n', ' File "C:\\git\\calibre\\src\\calibre\\utils\\formatter_ functions.py", line 109, in unregister_functions\n', ' File "C:\\git\\calibre\\src\\calibre\\utils\\formatter_ functions.py", line 102, in _register_functions\n']


Sorry for the format, but it's the only way to put at the proper point in windows.
Terisa de morgan is offline   Reply With Quote
Old 01-02-2024, 06:47 AM   #20
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No I want the stack from the __init__ function, line 155 in cache.py
kovidgoyal is offline   Reply With Quote
Advert
Old 01-02-2024, 08:19 AM   #21
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I can see these:

Spoiler:
INI-155: File "runpy.py", line 198, in _run_module_as_main
INI-155: File "runpy.py", line 88, in _run_code
INI-155: File "site.py", line 95, in <module>
INI-155: File "site.py", line 90, in main
INI-155: File "site.py", line 50, in run_entry_point
INI-155: File "C:\git\calibre\src\calibre\debug.py", line 231, in main
INI-155: File "C:\git\calibre\src\calibre\gui_launch.py", line 73, in calibre
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 552, in main
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 564, in run_main
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 402, in run_gui
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 418, in run_gui_
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 376, in initialize
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 355, in initialize_db
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 312, in initialize_db_stage2
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 255, in start_gui
INI-155: File "C:\git\calibre\src\calibre\gui2\ui.py", line 230, in initialize
INI-155: File "C:\git\calibre\src\calibre\gui2\actions\__init__. py", line 206, in do_genesis
INI-155: File "calibre_plugins.my_tools.action", line 89, in genesis
INI-155: File "calibre_plugins.my_tools.action", line 117, in build_menus
INI-155: File "C:\git\calibre\src\calibre\db\legacy.py", line 199, in __init__
INI-155: File "C:\git\calibre\src\calibre\db\cache.py", line 156, in __init__


and

Spoiler:
INI-155: File "runpy.py", line 198, in _run_module_as_main
INI-155: File "runpy.py", line 88, in _run_code
INI-155: File "site.py", line 95, in <module>
INI-155: File "site.py", line 90, in main
INI-155: File "site.py", line 50, in run_entry_point
INI-155: File "C:\git\calibre\src\calibre\debug.py", line 231, in main
INI-155: File "C:\git\calibre\src\calibre\gui_launch.py", line 73, in calibre
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 552, in main
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 564, in run_main
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 402, in run_gui
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 418, in run_gui_
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 376, in initialize
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 355, in initialize_db
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 312, in initialize_db_stage2
INI-155: File "C:\git\calibre\src\calibre\gui2\main.py", line 255, in start_gui
INI-155: File "C:\git\calibre\src\calibre\gui2\ui.py", line 416, in initialize
INI-155: File "calibre_plugins.goodreads_sync.action", line 110, in initialization_complete
INI-155: File "calibre_plugins.goodreads_sync.action", line 124, in rebuild_menus
INI-155: File "C:\git\calibre\src\calibre\db\legacy.py", line 199, in __init__
INI-155: File "C:\git\calibre\src\calibre\db\cache.py", line 156, in __init__


But, after both of them, functions are still in the list. In any case, I'm going to remove both plugins, see if that is the problem and how to solve it (goodreads_sync is a modified version)
Terisa de morgan is offline   Reply With Quote
Old 01-02-2024, 08:26 AM   #22
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your issue is caused by the my_tools plugin. Its creating a db and closing it (by not retaining a reference to it). It shouldnt be doing that.
kovidgoyal is offline   Reply With Quote
Old 01-02-2024, 09:31 AM   #23
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by kovidgoyal View Post
Your issue is caused by the my_tools plugin. Its creating a db and closing it (by not retaining a reference to it). It shouldnt be doing that.
Thank you. Using chaley's explanation, and your trace location, I've been able to solve the issue.

Sorry to have bothered both of you with something due to my lack of knowledge about some calibre aspects.
Terisa de morgan is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre 6 - problem loading user-defined template functions davidfor Library Management 4 07-12-2022 04:37 AM
Help Please - user defined USB problem HeavyTZM Library Management 4 11-26-2011 09:06 PM
Help Please - user defined USB problem HeavyTZM General Discussions 4 11-26-2011 05:36 PM
PRS-650 Search dictionary function problem Salt Sony Reader 15 01-17-2011 06:36 PM


All times are GMT -4. The time now is 05:35 PM.


MobileRead.com is a privately owned, operated and funded community.