Andrea Cosentino created CAMEL-24751:
----------------------------------------
Summary: camel-opa - unregister the OpaSecurityPolicy health check
when its routes stop
Key: CAMEL-24751
URL: https://issues.apache.org/jira/browse/CAMEL-24751
Project: Camel
Issue Type: Improvement
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
OpaSecurityPolicy registers a readiness check in beforeWrap but nothing
unregisters it when the routes it guards are stopped or removed, so a route
reload leaves the check behind in the HealthCheckRegistry reporting on a policy
that is no longer enforcing anything.
The registration is deduplicated by id, so this is bounded rather than a leak -
the stale check is wrong, not unbounded. Raised by davsclaus reviewing
https://github.com/apache/camel/pull/26436 and deferred there as out of scope
for that change.
OpaSecurityProcessor is a Service, so the shape of the fix is a ref-count:
count the wrapped processors that have started, and unregister from doStop once
the last one goes away. That has to be right under route reload (stop then
start of the same route) and under a policy shared by several routes, which is
why it wants its own change and its own tests rather than riding along with the
registration reorder.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)