locks
locks copied to clipboard
A scalable, deadlock-resolving resource locker
Trying to use locks app (master branch, c9b585a) I've got interesting failure in a scenario described below. There were 4 nodes alive connected to each other - A, B, C...
WIP. Added a random_netsplits test case to the `locks_leader_SUITE`. It currently fails. I've been working on improving the `locks_ttb` tracing support, and it now works much better for long-running test...
This PR tries to address both issues #37 and #30. * Refactoring to ease tracing * The locks_server now keeps a central version counter for strictly increasing versions * A...
`locks_watcher` is notified by https://github.com/uwiger/locks/blob/8e9b2e33deec6ed375a38fc88f67eff792b91504/src/locks_server.erl#L64 However, the message could be lost if a locks_server is started after https://github.com/uwiger/locks/blob/8e9b2e33deec6ed375a38fc88f67eff792b91504/src/locks_watcher.erl#L23 but the message is sent before the name `locks_watcher` is registered. https://github.com/uwiger/locks/blob/8e9b2e33deec6ed375a38fc88f67eff792b91504/src/locks_watcher.erl#L26
Addresses #38 No test created to verify initial race, but normal tests pass.
I was testing locks using my testcase. I believe that there is a bug in the lock_info handling of `locks_server` and `locks_agent`, which may cause deadlock. My testcase has 3...
How could we cancel/release a lock before the end of the transaction? Any idea how it could be implemented?
-spec lock_objects(pid(), objs()) -> ok. %% lock_objects(Agent, Objects) -> lists:foreach(fun({Obj, Mode}) when Mode == read; Mode == write -> lock_nowait(Agent, Obj, Mode); ({Obj, Mode, Where}) when Mode == read; Mode...
https://github.com/uwiger/locks/blob/master/src/locks.erl#L49 returns `{,{ok,[]}}`, but according to spec second element should be `lock_result() :: {lock_status(), deadlocks()}` where `lock_status() :: have_all_locks | have_none.` I can change https://github.com/uwiger/locks/blob/master/src/locks_agent.erl#L312 so it will match one...