Claus Ibsen created CAMEL-25088:
-----------------------------------

             Summary: camel-health - Health checks: fix bugs found in a deep 
review
                 Key: CAMEL-25088
                 URL: https://issues.apache.org/jira/browse/CAMEL-25088
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen


A review of the health checks in camel-health (and camel-main) found these bugs:

# With the {{default}} and {{oneline}} exposure level the result only includes 
the DOWN checks (or else the first check), so a check in the UNKNOWN state 
(such as a disabled check, a consumer with 
{{healthCheckConsumerEnabled=false}}, or {{camel.health.initialState=UNKNOWN}}) 
is left out and Camel reports ready, while the {{full}} exposure level reports 
not ready for the same state.
# {{camel.health.enabled=false}} does not disable the health check registry 
(the early return in BaseMainSupport skips setting enabled=false), so the 
checks are still loaded and invoked.
# RoutesHealthCheckRepository and ConsumersHealthCheckRepository never remove 
the check of a removed route, so each removed route (route reload, routes from 
templates/kamelets) is kept in memory.
# A health check that throws an exception fails the whole health check (the 
endpoint returns an error with no details) instead of the check being reported 
as DOWN.
# RouteHealthCheck throws NullPointerException when the route has been removed 
(such as during route reload).
# DefaultHealthCheckRegistry.register rejects a check whose id only resembles 
another check (a custom check {{foo}} is rejected when a route {{foo}} exists, 
{{x}} is rejected when {{x-health-check}} is registered).
# RouteHealthCheck reports the initial state of the registry for a suspended 
route (UP when initialState=UP), instead of DOWN as for a stopped route.
# The exclude pattern does not allow spaces around the comma ({{foo, bar}} does 
not exclude {{bar}}).

Not changed:
* The result strategy (HealthCheckResultStrategy) runs after the 
success/failure counters are updated.
* ScheduledPollConsumer.lastErrorDetails is a plain HashMap that is read by the 
health check thread.
* The health dev console lists the context check twice (readiness and liveness).

_Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to