Skip to content

fix(dgw): stop libsql from closing connections twice - #2074

Merged
Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
fix/libsql-double-close
Oct 14, 2026
Merged

Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
fix/libsql-double-close

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

libsql 0.9.30 closes a local connection twice when it's dropped (tursodatabase/libsql#2251). Since #2039 Gateway drops connections on startup, so some upgrades crash with 0xc0000005. libsql 0.10.0 ships the upstream fix (tursodatabase/libsql#2261), so this moves Gateway to it.

0.10.0 also updates the bundled SQLite from 3.45.1 to 3.47.0. The database file format doesn't change, so existing databases are unaffected.

Tested on Windows:

  • 8 threads doing connect / SELECT 1 / drop on a shared file DB: libsql 0.9.30 crashed 25/50 runs, 0.10.0 0/50
  • cargo clippy --workspace --tests -- -D warnings and cargo test --workspace pass

Fixes #2070

🤖 Generated with Claude Code

libsql 0.9.30 closes a local connection's SQLite handle twice when it's
dropped, which sometimes crashes Gateway on startup with 0xc0000005.
Patch it with the tursodatabase/libsql#2261 fix from the Devolutions
fork, tag 0.9.30-devo.1 (0.9.30 plus that one commit).

Issue: #2070

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:12
@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The fork contains only the verified upstream fix, and the lockfile consistently pins all affected crates.

0 open findings

What changed in this PR

Temporarily patches Gateway’s libsql dependency to prevent double-closing local connections during startup and upgrades.

Changes:

  • Uses Devolutions’ patched libsql 0.9.30 tag.
  • Updates all libsql lockfile entries to the pinned fork commit.
File Description
Cargo.toml Adds the temporary libsql patch.
Cargo.lock Locks libsql crates to the patched commit.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

libsql 0.10.0 ships the tursodatabase/libsql#2261 fix, the same commit
the Devolutions fork tag carried, so drop the [patch.crates-io] entry
and bump the libsql requirement to 0.10 in every crate.

Issue: #2070

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CBenoit
Benoît Cortier (CBenoit) merged commit c4066ca into master Oct 14, 2026
46 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the fix/libsql-double-close branch October 14, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Gateway can crash on startup because libsql closes connections twice

4 participants