Hi
i have a spring boot app (2.2.7.RELEASE) with Spring cloud (Hoxton.SR6) and i have an issue with Cronjob on K8s and i wonder if its a bug or misconfiguration from our side.
sometimes when the spring application finishing the work and status changed to DOWN we get the additional error of healthcheck failure.
Saw local status change event StatusChangeEvent [timestamp=1617818479572, current=DOWN, previous=UP]
Saw local status change event StatusChangeEvent [timestamp=1617818479586, current=OUT_OF_SERVICE, previous=DOWN]
hutting down DiscoveryClient ...
DataSource health check failed org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (Hikari) has been closed. at
DiscoveryClient_MYJOB/MyJob:73ddcf20013a9695468c8e436e5a0620: registering service...
DiscoveryClient_MYJOB/MyJob:73ddcf20013a9695468c8e436e5a0620 - registration status: 204
Completed shut down of DiscoveryClient
i understand the app is in the process of shutdown. why when app changes the status to DOWN the org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler checks the status of all Health Indicator. its obvious some of them will fail no?
i'm trying to understand how to handle this as i'm not sure its a bug or misconfiguration on our side.
thanks! CL
Comment From: spencergibb
What you described is working as designed. How could the EurekaHealthCheckHandler know the context?
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.