[Date Prev][Date Next]
[LMDB] Lockups with robust mutexes and crashing processes
posted this to the IRC channel, but there was no response, so I repost
trying out lmdb from master, including the robust mutex code. We're experiencing
lock ups after the process holding the lock dies, as if the robust lock
was not recovered. I tried to come up with an lmdb example that shows it
and I got it, just a few lines. It uses fork() just to automate it; see
that the environment is opened in both children. Here's the code:
I run this, I see that one of the children waits for the write lock and
is not awakened when the other child dies without closing the txn (but
notice I close the env). This is on purpose, to simulate a crashing process.The
worst part is that I can't reproduce it using directly libpthread and mmap.
Here is the code I came up with:
a little bit more verbose because I based it on a glibc test case.
we missing anything? It seems to us that the code follows does not break
any of LMDB's caveats (specially the one about creating the envs before
fork()'ing. Is it wrong to assume that the waiting process should recover
the lock from staleness?
for Amadeus SAS
T: +33 (4)4 9704 1727