uwiger / locks

A scalable, deadlock-resolving resource locker
Mozilla Public License 2.0
204 stars 26 forks source link

Making locks_leader pass locks-test #36

Closed uwiger closed 6 years ago

uwiger commented 6 years ago

Ref. https://github.com/ten0s/locks-test (see issue #30 )

Fixes include adding an election ref value, to sync with cands. This value is kept when the leader enters the safe loop. Also, an 'assert_leader' message is introduced, to ensure that candidates are kicked out of the safe loop when a leader acquires a new lock and remains the leader.

Also, a locks_agent:async_await_all_locks/1 function was added to ensure that the leader gets told that it has all locks in a contested scenario.