Hi,
sometimes is is necessary to run checks asynchronously as it is clear
that the execution time is to long to wait for them. Currently,
org.apache.sling.hc.samples.impl.AsyncHealthCheckSample shows the way to
do this using the scheduler. Although this is not too much code to
write, it locks down the behaviour of a health check to be either
synchronous or asynchronous depending on the implementation.
I have created a patch
(https://issues.apache.org/jira/browse/SLING-3744) for a HC property
hc.async.cronExpression that declaratively marks a health check as
asynchronous (by configuration). That way it can be decided by
operations later if the HC should be run sync or async and even allows
to run a check synchronously in one environment and asynchronously in
another env.
WDYT?
Regards
Georg
P.S. The feature was part of the initial patch for the health check
executor but we left it out to keep it simple for the first version. I
think now is a good time to bring it back!