Issue 35624: Shelve sync issues while using Gevent

Created on 2018-12-31 08:12 by Oded Engel, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg332807 - (view) Author: Oded Engel (Oded Engel) Date: 2018-12-31 08:12
Shelve method, sync, does not work when using gevent threading.
writeback was set to True, flag was set to 'c'.
only way to get the dbb synced is by closing and reopening the db.
msg332809 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2018-12-31 10:48
Hi, thanks for opening a bug report. Can you provide a script that reproduce the issue?
msg332994 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-01-04 19:43
3.6 only gets security fixes.  Please verify that there is a problem in 3.8 (or at least 3.7)

Also demonstrate that issue is not with the 3rd party gevent module.  Does gevent includes compiled non-python code?  (I suspect it does, but don't know.)  If so, your script should *not* import that extension.  Or you should close this as '3rd party' and submit a report to the gevent authors, who should be better able to determine where the problem originates.
msg333038 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-01-05 04:59
The docs already note a restriction: "the shelve module does not support concurrent read/write access to shelved objects".  We should further document that sync() is not thread-safe.  When sync() is running, the *writeback* attribute is set to False and other threads will stop updating the cache.
History
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79805
2019-01-07 15:16:09vstinnersetnosy: + vstinner
2019-01-05 04:59:47rhettingersetnosy: + rhettinger
messages: + msg333038
2019-01-04 19:43:37terry.reedysetnosy: + terry.reedy

messages: + msg332994
versions: + Python 3.8, - Python 3.6

2018-12-31 10:48:39remi.lapeyresetnosy: + remi.lapeyre
messages: + msg332809
2018-12-31 08:13:37Oded Engelsettype: behavior
2018-12-31 08:12:16Oded Engelcreate