-
Notifications
You must be signed in to change notification settings - Fork 8
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
After rqlite server restart, sqlalchemy-rqlite can not reconnect to server #4
Comments
It sounds like we need to give pyrqlite the ability to reconnect automatically. Do you know if some kind of exception is raised when it stops working? An exception would be a useful way to know when re-connection is necessary. |
Sorry I can't catch the exception when rqlited restart. When I log str(e), it show '' only, I don't know why.I circumvent this problem by unusing connection pool |
I've tested using the pyrqlite api directly, and I see multiple failure modes that vary depending on the python version. For Python 2.7.12, I observed httplib.CannotSendRequest from HTTPConnection.request(), and httplib.BadStatusLine from HTTPConnection.getresponse(). For Python 3.6.1, I observed BrokenPipeError from HTTPConnection.request(), http.client.CannotSendRequest from HTTPConnection.request(), and http.client.RemoteDisconnected from HTTPConnection.getresponse(). |
rqlite/pyrqlite@e0395b3 fixes pyrqlite to re-open the connection in case of server restart. |
We may want to add a pyrqlite connection parameter to control timeout. Also, it would be better if pyrqilte raised an exception derived from its base Error class, and used exception chaining to indicate the underlying cause. |
My python code
engine = create_engine('rqlite+pyrqlite://localhost:4001/')
At the beginning, it can work properly. When I restart rqlited, the engine becomes unavailable.Until I run create_engine again, it work properly. Is this a issue?
The text was updated successfully, but these errors were encountered: