You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/21 06:04:20 UTC

[jira] [Commented] (SLING-5874) Health Check Executor unnecessarily wastes 50ms

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

ASF GitHub Bot commented on SLING-5874:
---------------------------------------

GitHub user ghenzler opened a pull request:

    https://github.com/apache/sling/pull/157

    SLING-5874 improving timeout handling

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ghenzler/sling feature/SLING-5874-better-timeout-handling

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/sling/pull/157.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #157
    
----
commit 3a73d0c1be98cd266afaa3fa94412d2cb53c1fff
Author: georg.henzler <ge...@netcentric.biz>
Date:   2016-07-21T06:01:02Z

    SLING-5874 improving timeout handling

----


> 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)