Comments (4)
Thanks for opening this issue. I must admit that I thought that part of code was already in place, so it seems like I just missed to do that. Which means I would definitely accept a PR for that, although I would rather change the default is_broken()
implementation to do that for all connection implementations.
I'm also interested in other more targeted solutions for this, but I've failed to find something yet that's not coupled to a specific runtime or that would possibly block on drop or swallow errors. I think the postgres approach needs access to the underlying runtime to work. I'm also not user how they handle errors there or guarantee that it happens "fast" after dropping the future (which is somewhat important, so that the relevant future is not open for that long).
from diesel_async.
Turns out there was an existing function which checks for this and was just not hooked up - will push through a PR.
from diesel_async.
Solving it in a generic way does seem tricky. One possible idea for a DB-neutral solution would be a newtype that wraps the various pool implementations, and stores a vec of connections needing cleanup. Each time pool.get() is called, it could use that async context to clean up any of those objects, so if the pool is used with reasonable frequency, the objects in a bad state shouldn't stick around for long. I think deadpool provides a way to take a connection out of the pool, but don't know about bb8 or mobc, and it would add some extra complexity.
from diesel_async.
(sorry, meant to close+re-open the PR to re-run the tests)
from diesel_async.
Related Issues (20)
- Failed to find a type oid for ENUM_TYPE HOT 30
- Compiler requires `'static` when using transactions on generic AsyncConnection HOT 1
- The trait MultiConnection is not implemented
- conflicting implementations of trait `diesel_async::RunQueryDsl<_>` for type `paginate_async::PaginatedQuery<_, _>` HOT 4
- conflicting implementations of trait diesel_async::RunQueryDsl<_> for type paginate_async::PaginatedQuery<_, _> HOT 1
- use diesel_async::RunQueryDsl::execute conflicts with meilisearch_sdk execute HOT 5
- AsyncConnectionWrapper does not implement `build_transaction` HOT 2
- r2d2 not supported with AsyncPgConnection HOT 2
- Unable to connect to PostgreSQL in a separate Kubernetes pod using Diesel in Rust
- Failed to save array of enums HOT 2
- Is there some way to get the last insert id after an insert operation?
- Problem trait LoadQuery is not satisfied sub query when implement Pagination
- New release? HOT 1
- Incoherence between Diesel and Diesel_async on MySQL/MariaDB connection (UPDATE return value) HOT 1
- The conneciton pool returns corrupt connections HOT 3
- RunQueryDsl overrides calls to vec.first() to RunQueryDsl::first() HOT 4
- 0.4.x doesn't work with custom types HOT 1
- diesel_async does not support sql_query (async) HOT 3
- Unable to execute `COPY FROM`, likely due to missing `ExecuteCopyFromDsl` trait HOT 1
- Fail to get the connection with the features ["postgres", "bb8"] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diesel_async.