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

Commits on Jun 7, 2023

  1. 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.
    kamil-holubicki committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    7c65503 View commit details
    Browse the repository at this point in the history