You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.
But given that the database.Ping() returns an error only on the initial request (i.e. if the database goes down at some point, it will not return an error) the /live endpoint request returns 200 OK even if the database is down.
Are there any plans to fix this, perhaps by using database.Query("SELECT 1") instead of database.Ping()?
Thanks a lot.
The text was updated successfully, but these errors were encountered:
The behavior you're seeing is surprising to me. According to the docs, the Ping() method is supposed to verify that the connection is still alive. Which database driver are you using? I see some drivers implement Ping() a little differently:
If this is a widespread problem, I'd be happy to add a check like that into this package.
One other note: you likely want to use a readiness check rather than a liveness check for your upstream database. If the database is unreachable, you don't want to serve requests but you don't necessarily want your pod to be restarted.
Hello,
I'm trying to make use of this library to implement some healthchecks in my application.
My liveness check consists of a database ping check like this:
But given that the
database.Ping()
returns an error only on the initial request (i.e. if the database goes down at some point, it will not return an error) the/live
endpoint request returns200 OK
even if the database is down.Are there any plans to fix this, perhaps by using
database.Query("SELECT 1")
instead ofdatabase.Ping()
?Thanks a lot.
The text was updated successfully, but these errors were encountered: