eclipse / microprofile-health

microprofile-health
Apache License 2.0
107 stars 61 forks source link

Clarify that `mp.health.default.readiness.empty.response` is used only before user readiness checks are processed #283

Closed xstefank closed 3 years ago

xstefank commented 3 years ago

The property mp.health.default.readiness.empty.response which defaults to "DOWN" should be taken into account only when user checks are not yet processed. This means that when the runtime knows that the user didn't define any readiness checks then the call to /health/ready should be 200 OK ("UP") and not the value defined by this property.

This could be misinterpreted as the current section collides a little with the Health check procedures section where we state that "A producer with no readiness procedures expected or installed MUST return positive overall status (i.e. HTTP 200)". I made this error in our implementation.

In other words, the order of repeating calls to /health/ready should be 404 -> mp.health.default.readiness.empty.response -> user readiness checks outcome. If the user didn't define any readiness checks then this must be 404 -> mp.health.default.readiness.empty.response (defaults to "DOWN") -> 200 OK (as user didn't define any checks the final status is "UP").

/cc @pgunapal

pgunapal commented 3 years ago

Yeah, I agree, we should update the spec to clarify it. When applications are still starting up, we should reflect the mp.health.default.readiness.empty.response status, if its not specified, it should default to DOWN. Once the applications are started, then it should return the user defined readiness checks.