Return 503 until pages are loaded for the first time
This MR extends -pages-status
to return 503 if pages are not yet loaded for the first time.
This MR also makes to return 503 for every page until pages are not loaded for the first time.
This makes -pages-status
to be a proper health check that can be used by load balancer to verify
if given daemon of pages should be used for serving resources.
Solves part of https://gitlab.com/gitlab-com/infrastructure/issues/3078#note_48385498.
It does not solve pages being locked for whatever reason, but allows us to have uninterrupted pages operation.
How should it be used?
- Define
-pages-status /@healthz
(or anything else) - Make load balancer to use given daemon only if endpoint returns 200.