-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Generic Exception
s raised in MySql::Connection
#109
Comments
Adding specific exceptions sounds good. Feel free to send a PR or explain what use cases you have in mind. |
The context is: I'm utilizing this shard within another small shard (run as an executable) that connects to the database every so often (long story) within Kubernetes. Due to the raised database connection error my shard crashes, the container crashes, then the entire pod crashes. My goal is to handle specific exceptions so as to keep the loop happy and not bring down an entire Kubernetes pod. 😅 I'll submit a PR later on. |
If you use a connection pool instead of a direct connection you should be resilient to connection errors. I'm not sure how you are setting up/executing queries |
It's mostly related to credentials which have expired. Instead of crashing due to the exception it would be better for us to handle it specifically — to resolve it involves work outside of the container in question; it would eventually be killed off. I just don't want to rescue every exception because if something more serious is happening it would be better to deal with a standard noisy crash than skipping it on by. |
If credentials are wrong I would expect you to get a DB::ConnectionRefused. Isn't that the case? |
Now that I think of it, I have seen
|
Working with this shard there are specific exceptions I'd like to
rescue
from, but it looks like for the most partMysql::Connection
raises genericException
s.I'd like to throw out the idea of using more specific exception types and see what the maintainer and/or community thinks. I'm also willing to open a PR for the change if anyone's interested.
The text was updated successfully, but these errors were encountered: