Various HTTP states along the pipline are grouped into HANA_STATUS_*
codes, which are defined in checks.h. Then health_adjust()
is called with that status code, which ends up calling __health_adjust()
if the observe config parameter is enabled.
Example from proxy_http.c:
/* Adjust server's health based on status code. Note: status codes 501
* and 505 are triggered on demand by client request, so we must not
* count them as server failures.
*/
if (objt_server(s->target)) {
if (txn->status >= 100 && (txn->status < 500 || txn->status == 501 || txn->status == 505))
health_adjust(objt_server(s->target), HANA_STATUS_HTTP_OK);
else
health_adjust(objt_server(s->target), HANA_STATUS_HTTP_STS);
}
Inside __health_adjust()
(in checks.c)
- lookup the status code in
struct analyze_status
(which is defined in checks.h) - if it's determined that we are in an error state then one of the
HANA_ONERR_*
actions is taken