Please note that Bolt obtains a file lock on the data file so multiple
processes cannot open the same database at the same time. Opening an already
open Bolt database will cause it to hang until the other process closes it. To
prevent an indefinite wait you can pass a timeout option to the Open()
function:
Should treefmt specify a timeout here? Ideally treefmt would never hang, but it feels especially unfortunate that if it does hang, it'll cause other treefmt processes to hang.
While debugging https://github.com/numtide/treefmt/issues/406, I found that if you have one treefmt process hung, the next treefmt process you start up will get hung on this call to
bolt.Open
. This behavior is documented by bbolt:Should treefmt specify a timeout here? Ideally treefmt would never hang, but it feels especially unfortunate that if it does hang, it'll cause other treefmt processes to hang.