Open alexmorley opened 6 years ago
I found the same error. I didn't realize that diskdb does not work with multiple processes simultaneously accessing the same file. Working on a solution now.
Yeah, you'd have thought that'd be like no. 1 requirement for any database...
Don't know what progress you've made yet but the easiest fix I can think of is for a process to:
Thanks Alex. After exploring various solutions, looking at the source code for diskdb (and having some painful experiences)... I decided to roll my own (which does use a locking mechanism similar to what you suggest).
This needs to be tested!
I've just pushed the changes, and you can see the source code here: https://github.com/flatironinstitute/mountainlab-js/blob/master/mlproc/safedatabase.js
This passed, which is good news: https://travis-ci.org/flatironinstitute/mountainlab-js-tests
I don’t think it would be too painful to go back to Mongo (user-local installs are easy to spin up) if this turns out to be a bigger pain point.
Sent from my phone
On Jul 25, 2018, at 7:56 AM, Jeremy Magland notifications@github.com wrote:
This passed, which is good news: https://travis-ci.org/flatironinstitute/mountainlab-js-tests
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
e.g.
Errors like
I think its a race condition. Maybe two processes trying to write to the database at the same time? Or is this not the intended use?
Is there currently a lock on the database?