-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add backend-agnostic connection check #135
base: main
Are you sure you want to change the base?
Conversation
This is useful for avoiding database connection getting idle.
I don't like that this requires changes in every single backend. Based on that fact i'm voting 👎 . |
Could it also implement |
The whole idea of having a |
And it's not like |
The default minion setup, at least when used with minion plugin, is to establish a single persistent network connection with the backend, as long a the application is running. Ensuring this connection stays functional is mandatory when intermediate network equipments automatically cut off idle connections. So, the actual need is just to make easier to implement a keepalive mechanism to match this strategy. Actually, small differences between backends (each one use a different property to store its database object) require the application to handle each backend differently, ie:
With this small abstraction layer added to minion, this would turn to:
This keepalive mechanism would also be a useful addition to @jberger I may indeed add a
|
I get what you want to ultimately achieve, but the implementation makes no sense in a job queue API. Just look at the method description |
I just re-used the name and description of Alternatives solutions:
The first solution is basically making desencapsulation easier, the second one seems a better idea, but I'm unconfortable with the idea of private methods implemented in a child class, and used from a parent class. |
Summary
Each minion class backend uses a different attribute for its database connection object ('pg' for postgres backend, 'mysql' for mysql backend, etc). This makes low-level operations implementation-dependant.
Motivation
The change allows to send regular traffic to the backend, in order to avoid the database connection being closed for timeout, in a backend-agnostic way.
References
See discussion #2229.