Bug: Healthcheck & readiness probe (/-/liveness, /-/readiness) return 200 when missing database connection
Summary
When we were updating our database server, Gitlab could have had no connections to the database. This should have triggered our liveness & readiness probes, but it didn't because Gitlab returns 200-statuscodes when the database cannot be reached (e.g. connection refused).
Steps to reproduce
1.) Start up Gitlab with a database.
2.) Shut down the database, ensure that connections will be refused.
3.) Check /-/liveness
, /-/readiness
. They both return a non-5xx status response (200). However, this would contain a non-2xx code if e.g. gitaly was configured and not available.
Example Project
N/A
What is the current bug behavior?
The response-status for both endpoints is 2xx
What is the expected correct behavior?
The response status for at least one of the endpoints should be 4xx or 5xx
Possible fixes
Edited by Aleksei Lipniagov