buntdb
buntdb copied to clipboard
Noticed Deadlock? Sometimes buntdb gets stuck by a deadlock
Hi. Today, I decided to integrate buntdb via interfaces ( alongside boltdb ) as both libraries are very similar. When running the same code using buntdb, sometimes it generates a deadlock and gets stuck (probably the locking mechanism of buntdb). I want to say that I am running the same exact code using boltdb and I never noticed any deadlock using boltdb.
You can check both databases integrations via an interface https://github.com/PandoraPay/go-pandora-pay/tree/main/store/store-db
LE: Could it be because the string -> []byte cast? As keys and values are binary data casted as strings? LE2: Tested it again. Buntdb generates deadlock. Same code running with boltdb no deadlock spotted.
Hi. I would like to reproduce this issue. Could you provide the steps to cause the deadlock?
Hi @tidwall ! Thanks for the response. I will make you a tutorial tomorrow to reproduce it after I will test it again. Thanks again!
Today, I also noticed a deadlock. I was starting a read / write transaction (update) enclosed within a read-only transaction (view). Silly me running untested code.
Stumbled across this issue and thought this info might be interesting for other users. Cheers!