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
Gateway can crash on startup because libsql closes connections twice #2070
libsql 0.9.30 closes a local connection's SQLite handle twice when its last handle is dropped (tursodatabase/libsql#2251, fix waiting in tursodatabase/libsql#2261).
Most of the time nothing happens, sometimes it's an access violation.
#2039 makes this reachable on startup: the 2026.3 import and the probe connection in GatewayDb::open drop connections.
The job queue, the traffic audit and the 2026.3 agent tunnel keep theirs for the whole process, so they never hit it in production.
What I saw on a lab Windows Gateway running the #2039 build (934b26d):
2 of 2 first starts right after an MSI upgrade from 2026.3.0 crashed with 0xc0000005
4 of 50 starts that ran the import crashed, 0 of 40 plain restarts did
every dump stops in drop_in_place<libsql::local::connection::Connection> → sqlite3_close_v2
After a crash, service recovery restarts the Gateway 15 minutes later and that start finishes the import, nothing lost.
The same bug is already there in the traffic audit schema reset, and it's probably behind the STATUS_ACCESS_VIOLATION flakes in the Windows tests.
Options:
Don't drop libsql connections on startup: remove the probe in GatewayDb::open, and run the import on the long-lived gateway.db connection with ATTACH/DETACH instead of temporary connections.
Activity
feat(dgw): keep agent tunnel data in a shared gateway.db (#2039)
build(deps): use libsql 0.10.0 from crates.io