[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Loading modules every time without using a cache (sys.modules) can add significant overhead. -- ___ Python tracker ___ ___

[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I suggest removing the global state from dbm and just recomputing the underlying database for every call to open(). -- nosy: +rhettinger ___ Python tracker _

[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I added import experts because the issue looks relates to race condition in import. Willy, can the issue be reproduced on more modern Python releases (3.8 or 3.9)? It could help if you provide minimal script which reproduces it. -- nosy: +serhiy.s

[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-17 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-17 Thread gardener.willy
New submission from gardener.willy : Shelve module uses "import dbm" instruction while opening database. Dbm module has global dictionary "_modules". This dictionary modifies during database opening operation. When different threads simultaneously try to open different databases, unexpected b