Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(pool): always ping connection on release to see if it's still viable" #1129

Closed

Conversation

dignifiedquire
Copy link
Contributor

This reverts commit 0ed524d.

Unfortunately #1025 broke code that uses a SqlitePool, especially when using a max_connection count of 1.

@abonander
Copy link
Collaborator

I would prefer to find the underlying issue rather than reverting the fix as it probably just exposed another bug. SqliteConnection::ping() is a no-op which means it should be instantly released to the pool anyway. Could this possibly have been caused by #1080?

@dignifiedquire
Copy link
Contributor Author

I bisected things, and this is the exact commit that breaks things

@abonander
Copy link
Collaborator

This commit may be triggering a bug I just spotted in DecrementSizeGuard::drop() because it changes the timing of release() by always spawning it as a background task: https://github.com/launchbadge/sqlx/blob/master/sqlx-core/src/pool/inner.rs#L402-L407

If the waker at the head of the queue has no strong refcounts left then this will return instead of attempting to wake the next one. With a pool of size 1 this means that any waiting tasks will stall until they time out.

@dignifiedquire
Copy link
Contributor Author

This commit may be triggering a bug

I see that of course makes sense

@dignifiedquire
Copy link
Contributor Author

fixed on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants