Commit framework impl of health-check module plus required changes. The actual health checking is currently in progress, but wanted to add in at this stage.
Make aware of new status: Failed Health Check. Store the number of current passes/fails in shm
finish looping logic... place-holder for actual checking
move to per server conf, useful for adding HealthCheckCondition
Now implement the condition ruleset definition. The actual checking will be done in the actual health check routine.
just check watched servers... use 'hc' prefix for sub directives
Check that we have names for both templates and conditions
Don't bother w/ methods that return bodies. We don't handle them now anyway.
Use enums and structs to keep things better organized
1st cut of 'simple' tcp check... We reuse various proxy function and so this *could* be more streamlined, but use this to show how the other would work, since we need brigades, SSL/TLS support, etc.
Since every check needs this, do this in the main check loop. Allows some optimizations.
pull this out... large enough for a func
Move to a set of health check workers, mapping to each worker itself, instead of a single reused generic worker.
some ordering optimization
Make balancer manager health-check aware
And we now allow for health checks via OPTIONS *
Leverage the OPTIONS code for HEAD as well... So we now support: TCP, OPTIONS and HEAD.
Right now, anything other than an error (even a 404) is consider a PASS.
Fill in APLOGNO.
I hope that doesn't result in merge trouble for Jim.
Open up hook/scar to allow for passes/fails and method to be changed via bal-man...
OPTIONS/HEAD proxy function should be diff from simple TCP check
For OPTIONS and HEAD, only 2xx and 3xx are considered "passing" (until I implement the conditions expr testing)... honor the pass/fail count and LOG_INFO when the health check enables or disables a backend worker.
Start impl of expr conditions for runtime checks
Adjust log levels
correct error string
Use worker status character defines taken from mod_proxy.h instead of explicit characters.
Noted by rpluem.
With the updated ap_expr, we can now check for the returned response body, stored in kept_body
Assign log message tags
Implement expr lookup in mod_proxy_hcheck for variables whose names start with "HC_" and for the new function hc().
Currently only HC_BODY and hc(body) are supported. Both return the saved body of the health check response to be used in an expr that decides about success of a check.
Fix copy&paste error in new function.
Try fixing new proxy_hcheck expr extension.
Interestingly mod_ssl using NULL as well, but some other module I wrote uses parms->name.
Enabling a worker via health-check also moves them out of ERROR more (which may have been set via the static "health" check done via mod_proxy).