-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database locked sometimes #29
Comments
sqlite throws this error when locking the file fails, so it can't write to it. In absurd-sql, the only reason why locking would fail is if the change byte check fails here: https://github.com/jlongster/absurd-sql/blob/master/src/sqlite-util.js#L19 This is run from the https://github.com/jlongster/absurd-sql/blob/master/src/indexeddb/worker.js#L110 What can happen is a write commits during this upgrade unfortunately, because we are opening an entirely new IDB transaction. In that case, the lock must fail because the writes that were made to the db happened in a state that doesn't exist anymore. I'm still recovering context that I had a month ago; I can't remember if I had a solution for this. One blunt solution would be to always use |
Sometimes I get
database is locked
when I have two tabs, and sometimes they write to DB simultaneously. I use Microsoft edge(chrome-based browser), and it has the support of the Atomics & SharedBuffer.And I am curious how it could happen, cause the lock should be handled by IDB 🤔. Or maybe I missed something.
The screenshots from sentry:
And stack trace:
I didn't set up the source map, but I still hope that it will help somehow to understand why such error happens
The text was updated successfully, but these errors were encountered: