Georg Henzler created SLING-5874:
------------------------------------
Summary: Health Check Executor unnecessarily wastes 50ms
Key: SLING-5874
URL: https://issues.apache.org/jira/browse/SLING-5874
Project: Sling
Issue Type: Improvement
Components: Health Check
Reporter: Georg Henzler
Assignee: Georg Henzler
Currently the HC executor boldly waits for 50ms util it checks again if all
relevant futures have finished within the given timeout:
https://github.com/apache/sling/blob/eecc7e401a0894984a5eaa8992dedfcb5a18e0e5/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java#L365
This has the following disadvantages:
* The HC executor never returns a request under 50ms (even if the actual check
only takes 1ms like a "all OSGi bundle started" check does)
* Setting timeout values (e.g. via the HC servlet) lower than 50ms does not
work (effectively the timeout is increased to 50ms then)
For most cases the current behaviour is not really a problem, but for using the
HC for a load balancer when response time should be optimised as much as
possible, the HC servlet should be able to return in only slightly more time
than the longest check requires (so if a request checks for started bundles
only it should return in ~3ms instead of the current ~53ms).
To fix this the sleep shall be replaced with a Object.wait()/Object.notifyAll()
setup.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)