Giter VIP home page Giter VIP logo

Comments (10)

importcjj avatar importcjj commented on June 1, 2024

After the check-out of a pool connection, users will directly interact with the DB connection by the Deref mechanism, so it's hard for me to trace and mark what state the original conn is.

And I am turning to the maintainers of Redis-rs for help.

from mobc.

tailhook avatar tailhook commented on June 1, 2024

Yes, the point of this issue is that mobc provides appropriate hook to discard connections on check-in.

from mobc.

tailhook avatar tailhook commented on June 1, 2024

We also have to investigate how this works for postgres. Without proposed changes, it either has the same bug as redis or will error on the first request after checking out connection (latter is better as it isn't a security issue, but is still suboptimal).

from mobc.

importcjj avatar importcjj commented on June 1, 2024

Ok, I added a new hook to do some cleaning works on the check-in, but it defaults to be disabled.

from mobc.

tailhook avatar tailhook commented on June 1, 2024

Thanks. I don't understand the motivation for it to be opt-in, though. I believe it should be always enabled (i.e. there should be no configuration to disable it). This check should be cheap and ignoring it only degrades the performance and stability of the application. (Comparing to health check on check-in which might be slow as it sends things to the network and is safe to ignore if your connections are never idle for too long).

from mobc.

importcjj avatar importcjj commented on June 1, 2024

Since I chose to use an async hook at last, but I don't want to pay for the async transform cost. Do you think it is necessary to support async in this hook? Or it should just return boolean like what r2d2 does.

from mobc.

tailhook avatar tailhook commented on June 1, 2024

I like the idea to restrict it to sync code. Async here is a large monitoring issue, it's harder to account tasks spawned by the destructor in case they are stuck for some reason.

from mobc.

importcjj avatar importcjj commented on June 1, 2024

Hey! Sorry for late.

I have made some changes to the code, you may take a look at it.

#33

Suggestions for revision are welcome.

from mobc.

tailhook avatar tailhook commented on June 1, 2024

Suggested a different name in PR. Other than that, looks good. Thanks!

from mobc.

importcjj avatar importcjj commented on June 1, 2024

Thank you as well.

from mobc.

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.