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
fix(turso): replace client.transaction() with UPDATE...RETURNING to prevent connection leak in queue poller
@libsql/client's transaction() method sets this.#db = null after BEGIN
so that concurrent execute() calls use a separate connection. After
commit/rollback, the detached Database object is abandoned to GC. At the
default 100ms poll interval this orphans ~10 native SQLite connections
per second — more than GC can reclaim — exhausting OS file-handle or
native-heap limits and crashing the host process (exit code 5) after
5-10 minutes of idle operation.
Replacing the three-step SELECT + UPDATE + COMMIT with a single atomic
UPDATE...RETURNING via client.execute() preserves atomicity through
SQLite's implicit per-statement transaction while reusing the single
cached connection (execute() calls #getDb() without nulling #db).
Fixes: https://github.com/mizzle-dev/workflow-worlds/issues/TBD
0 commit comments