fix(icms): Throw 503 on config reload failure - #879
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🛡️ CodeQL Analysis🚨 Found 11 issue(s) Severity Breakdown:
📋 Top Issues🔗 View full details in Security tab 🕐 Last updated: 2026-08-14 19:15:26 UTC | Commit: 9516ace |
sanjay-saxena
left a comment
There was a problem hiding this comment.
The goal is to make K8s take the pods out of rotation via its readiness check whenever remote config refresh fails. This will automatically result in 503s to be reported by the infra. This would be similar to when Cassandra or any other dependency is not ready, K8s takes the pods out of rotations and reports 503.
There is a far simpler and Spring native approach to accomplish this by publishing an AvailabilityChangeEvent with ReadinessState.REFUSING_TRAFFIC. This can be used in conjunction with Spring Cloud K8s(SCK)'s ConfigurationUpdateStrategy. Using ConfigurationUpdateStrategy, we can raise the event with ReadinessState.REFUSING_TRAFFIC state when the config validation fails or with ReadinessState.ACCEPTING_TRAFFIC state when the config validation succeeds.
|
Right, we need to mark app health as |
9516ace to
a855344
Compare
Problem
A live configuration update can introduce an invalid value, such as a misspelled enum. Spring Cloud applies the new environment and destroys refresh-scoped beans, but normally recreates those beans lazily.
As a result, the refresh can appear successful while the application context is unusable. Requests later fail with misleading responses, while Kubernetes readiness remains healthy and continues routing traffic to the affected pod.
What changed
Added src/control-plane-services/instance-cluster-management/icms-core/src/main/java/com/nvidia/icms/configuration/refresh/ConfigRefreshConfiguration.java:
Added src/control-plane-services/instance-cluster-management/icms-core/src/main/java/com/nvidia/icms/configuration/refresh/RefreshScopeBeanValidator.java:
Added unit tests covering failed refreshes, recovery, readiness ownership, Spring event wiring, and non-refresh strategy behavior.
Added src/control-plane-services/instance-cluster-management/icms-service/src/test/java/com/nvidia/icms/ConfigRefreshFailureIntegrationTest.java:
Updated Bazel dependencies for Spring Cloud Kubernetes commons and Awaitility.
@sanjay-saxena I have a feeling this should go to parent lib.
Closes NVCF-11367