Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netflix Eureka Client Health Check Handler not sending correct status back to Netflix Eureka server #4072

Closed
kamaldesingh opened this issue Mar 4, 2022 · 5 comments · Fixed by #4074
Assignees
Labels
Milestone

Comments

@kamaldesingh
Copy link

Hello Team,

I have upgraded my application and below are details for same.

Previous Version-
spring boot-1.5.6.RELEASE
spring cloud version-Edgware.M1

Migrated Version-
spring boot-2.4.4
spring cloud version-2020.0.2

Herein, after migration I am faced issue with Client Eureka Health Check handler sending status as up always even though one of dependency say DB is down. This happens only in case where we have 2 or more beans of same type supposing in my application I had 2 LDAP connections and out of which one was down. Ideally, Eureka Client Health Check Handler should have sent DOWN status to Eureka Server but when I debugged it was sending UP status. Moreover, same works fine if I only have 1 LDAP connection then if connection is DOWN it sends back correct status.

Moreover, if we hit actuator health endpoint then it shows correct status as down but Eureka Client Health Check Handler sends UP status back to Eureka Server. Additionally, we have enabled the eureka health check by specifying property in application properties - eureka.client.healthcheck.enabled=true.

It was working fine in previous version we were using even I observed this is working fine with Spring Boot-2.1.18.RELEASE version, post that issue is occurring.

One more observation is that in Spring Boot 2.4.4 we saw that if we have 2 beans of same type they are getting registered under HealthContributor bean whereas in versions till Spring Boot-2.1.18.RELEASE beans were registered under HealthIndicators bean.

I am attaching the jsons from Spring Boot -1.5.6.RELEASE, 2.4.4 version with one bean and multiple beans of same type. Here you would see that for LDAP if I say we have nested components the health status by Eureka client for same is being skipped and if we don't have nested components in LDAP bean or any other dependency then health check by Eureka client is being checked for them as well.

Note-
I am referring to EurekaHealthCheckHandler present under spring-cloud-netflix-eureka-client jar. I am referring to health status being returned from this class back to Spring Cloud Netflix Eureka Server.

Spring_Boot-1 5 6 RELEASE_Working_Fine

Spring_Boot-2 4 4 RELEASE_Nested_Component_Issue

Spring_Boot-2 4 4_Single_Bean_Working_Fine_Issue

@kamaldesingh
Copy link
Author

Hello Team,

Kindly do assist on above request on priority.

@OlgaMaciaszek
Copy link
Collaborator

Hello, @kamaldesingh, Spring Cloud 2020.x is no longer supported. Please upgrade to Spring Cloud 2021.x and Spring Boot 2.6.x. If the issue still persists, please provide a minimal, complete, verifiable example that reproduces the issue - we will verify it then. Also, please note that the issues are handled according to the team's issues backlog and priorities - we always look at all the reported issues, but it might take some time. To have your issue prioritised on top of our backlog, you may consider VMware Spring Runtime.

@kamaldesingh
Copy link
Author

Hello @OlgaMaciaszek , have tried using Spring Cloud 2021.0.1 with Spring Boot 2.6.3 version as well, still have same issue. Eureka Client is not considering nested components of application while sending the aggregate health status of application as explained above .

@OlgaMaciaszek
Copy link
Collaborator

@kamaldesingh Please provide a minimal, complete, verifiable example that reproduces the issue.

@kamaldesingh
Copy link
Author

kamaldesingh commented Mar 9, 2022

@OlgaMaciaszek - Below are couple of code snippet...one is property file having 2 ldap beans and other is pom.xml with the dependencies I am using in my project.

application.properties

spring.application.name=spring-boot-demo spring.datasource.url= spring.datasource.username= spring.datasource.password= spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect spring.datasource.initialize=false spring.jpa.hibernate.ddl-auto=update spring.jpa.generate-ddl=true primary.ldap.contextSource.url= primary.ldap.contextSource.base= primary.ldap.contextSource.userDn= primary.ldap.contextSource.password= primary.ldap.contextSource.pooled=true secondary.ldap.contextSource.base= secondary.ldap.contextSource.password= secondary.ldap.contextSource.pooled=true secondary.ldap.contextSource.url= secondary.ldap.contextSource.userDn= eureka.client.healthcheck.enabled=true

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.6.3</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.example</groupId>
	<artifactId>spring-boot-demo</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>spring-boot-demo</name>
	<description>Demo project for Spring Boot</description>
	<properties>
		<java.version>11</java.version>
		<spring-cloud.version>2021.0.1</spring-cloud.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-ldap</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
	</dependencies>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>

@OlgaMaciaszek OlgaMaciaszek self-assigned this Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek added this to To do in 2022.0.0-M2 via automation Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek added this to To do in 2021.0.2 via automation Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek added this to the 3.1.2 milestone Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek moved this from To do to In progress in 2021.0.2 Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek moved this from To do to In progress in 2022.0.0-M2 Mar 9, 2022
@OlgaMaciaszek OlgaMaciaszek linked a pull request Mar 10, 2022 that will close this issue
@OlgaMaciaszek OlgaMaciaszek moved this from In progress to Done in 2021.0.2 Mar 17, 2022
@OlgaMaciaszek OlgaMaciaszek moved this from In progress to Done in 2022.0.0-M2 Mar 17, 2022
@OlgaMaciaszek OlgaMaciaszek added this to To do in 2020.0.6 via automation Jun 30, 2022
@OlgaMaciaszek OlgaMaciaszek moved this from To do to Done in 2020.0.6 Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
2021.0.2
  
Done
2022.0.0-M2
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants