You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure where the bug is exactly, but executing this code at the root of the project:
import{DB}from'./mod.ts';constdb1=newDB('foo.db');db1.query(`SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size()`);db1.close();
And logging each time js_lock and js_unlock are called with something like this:
~/Downloads/deno-sqlite-master 2 ❯ deno run -A test.ts
[js_lock] rid: 3, exclusive: 0
[js_lock] rid: 3, exclusive: 0
~/Downloads/deno-sqlite-master 2 ❯
As we can see sqlite is requesting shared locks, but it's never releasing them. As long as there are shared locks an exclusive lock shouldn't be obtainable, so really sqlite here should be asking to unlock the database after its done with it, not asking for a shared lock twice, or it will prevent anybody else from writing to it, which can't be right.
I'm not sure what causes this bug. Maybe xCheckReservedLock can't be a sort of no-op?
This is worth investigating because without any form of locking that works I don't know how usable the approach really is.
The text was updated successfully, but these errors were encountered:
I'm not sure where the bug is exactly, but executing this code at the root of the project:
And logging each time
js_lock
andjs_unlock
are called with something like this:I get this log:
As we can see sqlite is requesting shared locks, but it's never releasing them. As long as there are shared locks an exclusive lock shouldn't be obtainable, so really sqlite here should be asking to unlock the database after its done with it, not asking for a shared lock twice, or it will prevent anybody else from writing to it, which can't be right.
I'm not sure what causes this bug. Maybe
xCheckReservedLock
can't be a sort of no-op?This is worth investigating because without any form of locking that works I don't know how usable the approach really is.
The text was updated successfully, but these errors were encountered: