Skip to content

[Bug]: DataFixerHealthIndicator returns DOWN on first domain failure, discarding other results #214

@Splatcrafter

Description

@Splatcrafter

AI REVIEWED

Module: spring-boot-starter
File: spring/actuator/DataFixerHealthIndicator.java (~line 181-196)
Severity: Medium

Summary

The health check iterates over domains but returns Health.down() immediately on the first failure. Details from already-checked healthy domains are discarded, giving an incomplete picture.

Expected Behavior

All domains should be checked. The final health status should be DOWN if any domain failed, but all details (healthy and unhealthy) should be included.

Actual Behavior

for (Map.Entry<String, AetherDataFixer> entry : fixers.entrySet()) {
    try { /* ... */ }
    catch (Exception e) {
        return Health.down()... // exits immediately, loses prior domain details
    }
}

Suggested Fix

Collect all results, then decide:

boolean allHealthy = true;
Health.Builder builder = Health.up();
for (...) {
    try {
        builder.withDetail(domain + ".status", "UP");
    } catch (Exception e) {
        allHealthy = false;
        builder.withDetail(domain + ".status", "DOWN");
        builder.withDetail(domain + ".error", e.getMessage());
    }
}
return allHealthy ? builder.build() : Health.down().withDetails(builder.build().getDetails()).build();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions