HealthCheckServiceInstanceListSupplier docs say all instances are returned when none are healthy, but code returns an empty list
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- java, spring, spring-boot
- Ambito
- backend, documentation, testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
ServiceInstanceListSupplierare 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.
- Lingua principale
- Java
- Stelle
- 750
- Fork
- 749
- Merge medio
- 17h 13m
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-cloud/spring-cloud-commons
-
waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spring-cloud/spring-cloud-commons#1708 ·
I maintainer di solito rispondono entro 1 giorno
-
waiting-for-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
spring-cloud/spring-cloud-commons#1543 ·
I maintainer di solito rispondono entro 1 giorno
-
waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 48/100
spring-cloud/spring-cloud-commons#1727 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement for team discussion
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
spring-cloud/spring-cloud-commons#1676 ·
I maintainer di solito rispondono entro 1 giorno
-
waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
spring-cloud/spring-cloud-commons#1675 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di spring-cloud/spring-cloud-commons
Issue simili
-
staticAssetsPath follows symlinks outside the directory on WindowsForse già presa @ybelMekk l’ha presa oggi. Apertabug security findings
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
navikt/mock-oauth2-server#1132 ·
I maintainer di solito rispondono entro 1 giorno
-
agent:working follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Sanne/incus-spawn#1683 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
checkstyle/checkstyle#22210 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
google/error-prone#6239 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Failing Test]: BigqueryClient.queryUnflattened fails BigQuery ITs on a transient 503Forse già presa @mxtymoshyk l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno