Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,771 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@bhosale-mahesh がすでに取り組んでいます。

2026年10月17日 から。

  • #1772 @bhosale-mahesh による — オープン
  • #1773 @bhosale-mahesh による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, spring, spring-boot

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Java
スター
751
フォーク
746
平均マージ
16時間 35分
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-commons のほかの issue

spring-cloud/spring-cloud-commons の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。