Skip to content

Make connection pool fully async to prevent tokio runtime starvation#1959

Closed
crodas wants to merge 1 commit into
cashubtc:mainfrom
crodas:feature/make-sql-pool-async
Closed

Make connection pool fully async to prevent tokio runtime starvation#1959
crodas wants to merge 1 commit into
cashubtc:mainfrom
crodas:feature/make-sql-pool-async

Conversation

@crodas
Copy link
Copy Markdown
Collaborator

@crodas crodas commented May 10, 2026

Description

Replace std::sync::Condvar with tokio::sync::Notify in the connection pool. The blocking Condvar::wait_timeout was starving the tokio runtime when pool size=1 (in-memory SQLite), causing 5s cascading timeouts on concurrent ops.


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

Replace std::sync::Condvar with tokio::sync::Notify in the connection pool.
The blocking Condvar::wait_timeout was starving the tokio runtime when pool
size=1 (in-memory SQLite), causing 5s cascading timeouts on concurrent ops.
@crodas crodas self-assigned this May 10, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in CDK May 10, 2026
@thesimplekid
Copy link
Copy Markdown
Collaborator

Does this replace #1808? It seems pretty similar what are the differences that we don't just finish that PR?

@crodas
Copy link
Copy Markdown
Collaborator Author

crodas commented May 10, 2026

Does this replace #1808? It seems pretty similar what are the differences that we don't just finish that PR?

I will finish #1808. This is what I did to pass tests on #1954, but I will close this in favor of #1808

@crodas crodas closed this May 10, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in CDK May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants