This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git
The following commit(s) were added to refs/heads/master by this push:
new cdf57d8f5d FELIX-6613 : ServicesCheck still reports services available
after they are gone
cdf57d8f5d is described below
commit cdf57d8f5d5ade15f483b2b2138b5e74a68c2dae
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Wed Jun 7 15:23:22 2023 +0200
FELIX-6613 : ServicesCheck still reports services available after they are
gone
---
.../src/main/java/org/apache/felix/hc/generalchecks/ServicesCheck.java | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/ServicesCheck.java
b/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/ServicesCheck.java
index 4f2d9a831b..7ffb57bdf6 100644
---
a/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/ServicesCheck.java
+++
b/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/ServicesCheck.java
@@ -180,6 +180,8 @@ public class ServicesCheck implements HealthCheck {
}
public boolean present() {
+ // getService() is used as this a) ensures the service is really
available (e.g. in case of lazy DS components)
+ // and b) the result of getService() is cached; causing the least
performance impact
return this.stracker.getService() != null;
}