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
{{ message }}
Repository navigation
close() from a user function inside a write transaction's statement blocks #26
MiniGrafDb.close() rolls back every open WriteTransaction by locking each transaction's slot (slot.lock()). While a transaction's statement runs, WriteTransaction::execute holds that slot. A user function that calls db.close() from inside that statement therefore blocks the JS thread on a mutex its own thread holds: the process hangs.
Expected:close() from inside a statement does not hang. Either it refuses with INT-001 (as a re-entrant call into the transaction already does via try_lock), or it closes the database and the running transaction is finished as soon as its statement returns, with later calls failing with API-018.
Possible fix: in close(), use try_lock on each slot. On WouldBlock (only possible through re-entry, since there is one JS thread), either refuse with INT-001, or mark the slot to be rolled back when execute releases it.
Activity