-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDB_BAD_RSLOT after fork due to spare txn #346
Comments
callumwalker
pushed a commit
to callumwalker/py-lmdb
that referenced
this issue
Jun 12, 2024
jnwatson
added a commit
that referenced
this issue
Jan 8, 2025
Also, don't create spare transactions if the above parameter is true. This prevents hanging open transactions across forks. This is exhibited in a MDB_BAD_RSLOT error. Fixes #346.
jnwatson
added a commit
that referenced
this issue
Jan 9, 2025
Default max_spare_txns on cpython impl to 0. Also, don't create spare transactions if the above parameter is true. This prevents hanging open transactions across forks. This was exhibited by a MDB_BAD_RSLOT error. Fixes #346. Grab most of the changes suggested in #363. Thank you to callumwalker for their contribution. This records the PID at environment creation time and prevents deletion of transactions when we're not on that PID.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected Operating Systems
Affected py-lmdb Version
1.4.0
py-lmdb Installation Method
sudo pip install lmdb==1.4.0
Also built from source to enable debugging.
Using bundled or distribution-provided LMDB library?
Bundled
Distribution name and LMDB library version
(0, 9, 29)
Describe Your Problem
Hi,
Using LMDB in a program that forks but which does not use LMBD inside the fork is giving me the following error
I've written the following testcase to reproduce the issue
On 1.4.0 this is giving me the following output
If I comment out caching the transaction in
trans_dealloc
I getAs I'm not actively using LMDB inside the forked process I believe that this should be something that LMDB supports but maybe I need to change my code to explicitly close the environment before forking.
The text was updated successfully, but these errors were encountered: