[ 
https://issues.apache.org/jira/browse/SLING-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13852213#comment-13852213
 ] 

Georg Henzler commented on SLING-3278:
--------------------------------------

Competition in general is not that bad, I agree :)

Find attached my patch that adresses comments from above:
* Removed author tags, reformatting lines and sling plugin from pom
* I added the method Result run(ServiceReference healthCheckReference) to 
execute a single health check with caching/timeout checks in place. The 
parameter is not of type HealthCheck as this would push the responsibility for 
getting/ungetting the service to the user of the interface
* I tried to not use HealthCheckDescriptor in result (and make it private to 
the bundle by moving it to impl.executor)... however, I think the code gets 
worse then (an extra map would be needed to keep references by descriptor). In 
general I think it's good design to have the descriptor: It is a different type 
of attributes and for the user it is immedately clear that these attributes 
won't change over time. Also ServiceReferences can safely be cached reused 
(opposed to the service class itself) and HealthCheckDescriptor is immutable.
* Timing information: We cannot use a created date in the Result constructor 
because the instance of the result is created by the implementing class and 
there is no guarantee, that new Result(..) is called at the beginning of a 
check (rather it will normally be called at the very end!). 



> 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-18.patch, 
> SLING-3278-hc.core-HealthCheckExecutorService-v0.5.patch, 
> SLING-3278-hc.webconsole-2013-12-18.patch, 
> SLING-3278-hc.webconsole-v0.5.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)

Reply via email to