Giter Club home page Giter Club logo

Comments (4)

weiznich avatar weiznich commented on August 19, 2024

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.

dae avatar dae commented on August 19, 2024

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.

dae avatar dae commented on August 19, 2024

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.

dae avatar dae commented on August 19, 2024

(sorry, meant to close+re-open the PR to re-run the tests)

from diesel_async.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.