[
https://issues.apache.org/jira/browse/SLING-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13852761#comment-13852761
]
Bertrand Delacretaz commented on SLING-3278:
--------------------------------------------
I'm also for having an executor method that takes a single HealthCheck -
getting the service is not expensive, I don't think that's a problem, and
that's consistent with how we generally do things in Sling.
bq. We cannot use a created date in the Result constructor because the instance
of the result is created by the implementing class...
It's created when the check is done executing, as the Result is immutable
there's no other way. So I think storing the creation timestamp at that point
is fine. If a health check starts at T, runs for 2 minutes and has a time to
live of 1 minute, you want to kill it at T+3, not T+1. So IMO we should set the
Result creation time in its constructor, have a method to set the time to live
and an isExpired method that becomes true at T+3 in my example.
In the meantime I've thought about a fluent API that looks better for the
executor, started a thread on our dev list to discuss that ("[RT] Fluent API
for HealthCheckExecutor"). That would have little impact to the core of your
patch, but provide a more flexible API, including per-call execution timeouts
and the ability to clear some or all cached results at will.
> Provide a HealthCheckExecutor service
> -------------------------------------
>
> Key: SLING-3278
> URL: https://issues.apache.org/jira/browse/SLING-3278
> Project: Sling
> Issue Type: New Feature
> Components: Health Check
> Reporter: Georg Henzler
> Assignee: Georg Henzler
> Attachments: SLING-3278-bertrand.patch,
> SLING-3278-hc.core-HealthCheckExecutorService-2013-12-19.patch,
> SLING-3278-hc.webconsole-2013-12-19.patch, hc-it.patch
>
>
> Goals:
> * Be able to get an overall (aggregated) result as quickly as possible
> (ideally <2sec)
> * Whenever possible, return most current results (e.g. for a memory check)
> * Provide a declarative way for async checks (async checks should be the
> exception though)
> Approach
> * Run checks in parallel
> * Make sure long running (or even stuck) checks are timed out
> * If a health check must run asynchronously (because its execution time
> cannot be optimized), it should be enough to just specify a service property
> (e.g. "hc.async").
> See also
> http://apache-sling.73963.n3.nabble.com/Health-Check-Improvements-td4029330.html#a4029402
> http://apache-sling.73963.n3.nabble.com/Health-checks-execution-service-td4028477.html
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)