Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

HealthCheckServiceInstanceListSupplier docs say all instances are returned when none are healthy, but code returns an empty list

Abierto
#1,771 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@bhosale-mahesh ya está trabajando en esto.

Desde el 17/10/2026.

  • #1772 de @bhosale-mahesh — abierto
  • #1773 de @bhosale-mahesh — cerrado sin fusionar

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
50/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, spring, spring-boot

Línea de trabajo

Start by reading HealthCheckServiceInstanceListSupplier.java around the Flux.merge result handling and comparing the behavior with the reference documentation. Check HealthCheckServiceInstanceListSupplierTests.java, especially shouldEmitAllInstancesIfAllIsAliveChecksFailed, to understand the currently asserted empty-list behavior. Before changing anything, determine from project discussion whether the intended fix is documentation, Javadoc, the test name, or the implementation; done means the documented, tested, and implemented behavior agree.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

documentation

Summary

The docs, javadoc and one test name say HealthCheckServiceInstanceListSupplier returns all instances when none are healthy. Code and test assertions return an empty list. Checked on v5.0.3 and main.

What the docs say

Instance Health-Check for LoadBalancer:

It regularly verifies if the instances provided by a delegate ServiceInstanceListSupplier are still alive and only returns the healthy instances, unless there are none - then it returns all the retrieved instances.

Class javadoc says "...only returns the healthy one, unless there are none."

What the code does

When all checks fail, Flux.merge(checks) emits nothing. Both paths then produce an empty list:

HealthCheckServiceInstanceListSupplier.java lines for the result / defaultIfEmpty(result) / collectList() block

List<ServiceInstance> result = new ArrayList<>();
if (healthCheck.isUpdateResultsList()) {
	return Flux.merge(checks).map(alive -> {
		result.add(alive);
		return result;
	}).defaultIfEmpty(result);   // result is empty
}
return Flux.merge(checks).collectList();   // empty list

What the tests assert

shouldEmitAllInstancesIfAllIsAliveChecksFailed: the name says "all", the assertion expects an empty list.

HealthCheckServiceInstanceListSupplierTests.java lines for that test

.expectNext(Lists.list())

shouldRepeatIsAliveChecksIndefinitely and shouldTimeoutIsAliveCheck also expect [] in the first round.

Question

Which one is intended?

  • Docs are wrong: Will create PR for fix in docs, javadoc and the test name.
  • Code is wrong: Will create PR returns all instances when none are healthy, with tests.
Lenguaje dominante
Java
Estrellas
751
Forks
746
Merge medio
16 h 35 min
PR fusionados (30 d)
23

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de spring-cloud/spring-cloud-commons

Todos los issues de spring-cloud/spring-cloud-commons

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.