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 337d2ad FELIX-6447 : Log every status change of a HC
337d2ad is described below
commit 337d2add5f7aefbd73633f77219cc11cb3931ac7
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Sun Aug 15 09:43:14 2021 +0200
FELIX-6447 : Log every status change of a HC
---
healthcheck/core/pom.xml | 21 +++++++++++----------
.../core/impl/executor/HealthCheckResultCache.java | 9 +++++++--
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/healthcheck/core/pom.xml b/healthcheck/core/pom.xml
index 625fac6..1165d2d 100644
--- a/healthcheck/core/pom.xml
+++ b/healthcheck/core/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.felix</groupId>
<artifactId>felix-parent</artifactId>
- <version>6</version>
+ <version>7</version>
<relativePath />
</parent>
@@ -39,8 +39,8 @@
<properties>
<felix.java.version>8</felix.java.version>
- <pax-exam.version>4.11.0</pax-exam.version>
- <pax-link.version>2.6.2</pax-link.version>
+ <pax-exam.version>4.13.4</pax-exam.version>
+ <pax-link.version>2.6.7</pax-link.version>
<org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
<felix.shell>false</felix.shell>
<project.bundle.file>${project.build.directory}/${project.build.finalName}.jar</project.bundle.file>
@@ -59,7 +59,7 @@
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
- <version>4.1.0</version>
+ <version>5.3.0</version>
<executions>
<execution>
<goals>
@@ -109,6 +109,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
+ <version>3.0.0-M5</version>
<executions>
<execution>
<goals>
@@ -169,7 +170,7 @@
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.quartz</artifactId>
- <version>2.3.0_2</version>
+ <version>2.3.2_1</version>
<scope>provided</scope>
<!-- if not present in runtime, there is no support for async
health checks -->
<optional>true</optional>
@@ -179,7 +180,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.utils</artifactId>
- <version>1.11.0</version>
+ <version>1.11.8</version>
<scope>provided</scope>
</dependency>
@@ -187,19 +188,19 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.13</version>
+ <version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>3.3.3</version>
+ <version>3.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
- <version>1.6R6</version>
+ <version>1.7.6</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -247,7 +248,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>5.6.10</version>
+ <version>6.0.5</version>
<scope>test</scope>
</dependency>
<!-- END test scope dependencies -->
diff --git
a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/executor/HealthCheckResultCache.java
b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/executor/HealthCheckResultCache.java
index d91abac..6bdcbfd 100644
---
a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/executor/HealthCheckResultCache.java
+++
b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/executor/HealthCheckResultCache.java
@@ -52,7 +52,12 @@ public class HealthCheckResultCache {
/** Update the cache with the result */
public void updateWith(HealthCheckExecutionResult result) {
final ExecutionResult executionResult = (ExecutionResult) result;
- cache.put(executionResult.getServiceId(), result);
+ final HealthCheckExecutionResult previous =
cache.put(executionResult.getServiceId(), result);
+ if ( previous == null
+ || previous.getHealthCheckResult().getStatus() !=
result.getHealthCheckResult().getStatus()
+ ||
!previous.getHealthCheckResult().toString().equals(result.getHealthCheckResult().toString()))
{
+ logger.info("Updating HC result for {} : {}",
result.getHealthCheckMetadata().getName(), result.getHealthCheckResult());
+ }
// update cache for sticky handling
Status status = executionResult.getHealthCheckResult().getStatus();
@@ -139,7 +144,7 @@ public class HealthCheckResultCache {
}
/** Creates a new execution result
- *
+ *
* @param origResult
* @return */
public HealthCheckExecutionResult
createExecutionResultWithStickyResults(HealthCheckExecutionResult origResult) {