Comments (10)
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.
Yes, the point of this issue is that mobc
provides appropriate hook to discard connections on check-in.
from mobc.
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.
Ok, I added a new hook to do some cleaning works on the check-in, but it defaults to be disabled.
from mobc.
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.
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.
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.
Hey! Sorry for late.
I have made some changes to the code, you may take a look at it.
Suggestions for revision are welcome.
from mobc.
Suggested a different name in PR. Other than that, looks good. Thanks!
from mobc.
Thank you as well.
from mobc.
Related Issues (20)
- redis::cmd.query_async does not work with mobc pool HOT 3
- Possible pool depletion and elevated number of timeouts HOT 1
- Adding Support for Redis Cluster Async HOT 1
- Pool should check for max idle lifetime in cleaner
- Incompatible with latest stable actix-web HOT 4
- Mobc should report errors HOT 1
- mobc completely stops serving connections. HOT 6
- New features require- Provide an Async function callback when deleting a Connection
- Access to mobc
- mobc-postgres page on crates.io links to archived repository HOT 1
- Metrics related to opened connections are registered incorrectly HOT 1
- Allow use of latest `redis` patch release HOT 1
- Please release new version of `mobc-redis` HOT 2
- Configuring a `Pool` for unlimited open connections will result in no connection reuse HOT 3
- `mobc_pool_connections_idle` reports "connection limit" on start, and "connections left to connection limit" later HOT 6
- Debug for Pool struct HOT 5
- Metrics crate needs to be bumped to fix ahash compilation failure on Rust Nightly HOT 2
- `mobc-redis` need update
- Why weren't the previous two connections reused, but instead two new connections were created?
- max lifetime does not work
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 mobc.