basho/bitcask

Lock file staleness check could be more robust [JIRA: RIAK-2230]

Opened this issue · 0 comments

JKoff commented

A few days ago, we started getting {error,locked} errors on certain puts in a development environment. After some digging, I found that bitcask_lockops:delete_stale_lock/1 was incorrectly returning not_stale for bitcask.write.lock files when the pid had been reassigned (in our case to a rabbitmq beam process.) This is because it uses kill -0, which merely verifies a process' existence, not its identity.

A workaround is to stop Riak and delete all bitcask.write.lock files.