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
Thus, when (the last of the clones of) ConnectionWrapper is dropped, synchronous I/O will be performed in what is surely to be an async context. This is, of course, logically incorrect behavior that can lead to quite a few problems including panics.
I did hesitate to add any sync database drivers to deadpool for that exact reason. I should've known better than releasing a half-baked implementation of this. 😞
Please review #115 which fixes this problem. Thanks a lot!
ConnectionWrapper
wraps arustqlite::Connection
which implements aDrop
that may perform synchronous I/O:Thus, when (the last of the clones of)
ConnectionWrapper
is dropped, synchronous I/O will be performed in what is surely to be an async context. This is, of course, logically incorrect behavior that can lead to quite a few problems including panics.In general, wrapping a synchronous connection correctly (or any other I/O object) is incredibly error-prone. Please see our implementation in
rocket_sync_db_pools
where we've painstakingly tried to address all of the relevant issues: https://github.com/SergioBenitez/Rocket/blob/693f4f9ee50057fc735e6e7037e6dee5b485ba10/contrib/sync_db_pools/lib/src/connection.rs.The text was updated successfully, but these errors were encountered: