blockchain-core
blockchain-core copied to clipboard
Add inspection for blockchain_lock
You can inspect who is waiting/holding the blockchain lock by using recon to look at who is monitoring the pid and who the lock pid is monitoring. Make a real function that does this automatically like blockchain_lock:debug()
. You can use process_info to look at the monitor states without calling into the process (which is unavailable when the lock is held).
Another couple ideas:
- Make it so blockchain locks can never be leaked by crashes, so we don't have to worry about try/catching
- Detect/log when the lock is being held or waited on for a long time