Skip to content
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

Improve logging of problems during db connection #1489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kamil-holubicki
Copy link

Problem:
Some error logs indicate only the error returned by the server without the information about the server identity itself.
On the other hand there are also logs which display the server identity together with the returned error.

Cause:
There is an utility layer implemented by golib/sqlutils which intercepts database queries. Some queries done by orchestrator go through this layer and some don't.
sqlutils layer in case of query error prints out the query to the stdout

Solution:
golib/sqlutils layer is not aware of the server identity it operates on. It proxies creation of sql.DB object and then uses this object for queries execution.

Logger interface has been introduced. golib/sqlutils client can register its own logger which will be used instead of internal logging when the error occurs during usage of the related sql.DB object.

I am taking time off from maintaining this repo. I will not be reviewing pull requests.

Details in https://code.openark.org/blog/mysql/reducing-my-oss-involvement-and-how-it-affects-orchestrator-gh-ost

Related issue: https://github.com/openark/orchestrator/issues/0123456789

Description

This PR [briefly explain what is does]

Some error logs indicate only the error returned by the server without
the information about the server identity itself.
On the other hand there are also logs which display the server identity
together with the returned error.

Cause:
There is an utility layer implemented by golib/sqlutils which intercepts
database queries. Some queries done by orchestrator go through this
layer and some don't.
sqlutils layer in case of query error prints out the query to the stdout

Solution:
golib/sqlutils layer is not aware of the server identity it operates on.
It proxies creation of sql.DB object and then uses this object for
queries execution.

Logger interface has been introduced. golib/sqlutils client can register
its own logger which will be used instead of internal logging when the
error occurs during usage of the related sql.DB object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant