Skip to content

Commit

Permalink
Fix jnwatson#346: MDB_BAD_RSLOT after fork due to spare txn
Browse files Browse the repository at this point in the history
  • Loading branch information
Callum Walker committed Jun 12, 2024
1 parent 9ec818b commit 658b193
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lmdb/cpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,12 @@ env_clear(EnvObject *self)

txn = self->spare_txn;
if(txn) {
MDEBUG("killing spare txn %p", txn);
txn_abort(txn);
if (self->pid != getpid()) {
MDEBUG("In forked process, not killing spare txn %p", txn);
} else {
MDEBUG("killing spare txn %p", txn);
txn_abort(txn);
}
self->spare_txn = NULL;
}

Expand Down

0 comments on commit 658b193

Please sign in to comment.