NPE in canCompleteSwap if path doesn't exists

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

@waterWang がすでに取り組んでいます。

2026年7月28日 から。

  • #3162 @waterWang による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
api, backend

調査の方向性

helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java の 552-555 行目から始め、canCompleteSwap REST エントリーポイントを追跡します。パスが破損しているか存在しないケースを再現し、その後、操作が NPE なしで true を返すことを確認します。

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

説明

bug
Describe the bug

Currently when we call baseAccessor.getChildNames and if the path doesnt exists, swapOutResources is null, and we iterate over this which results in NPE

  "error" : "Cannot invoke \"java.util.List.iterator()\" because \"swapOutResources\" is null"
}
To Reproduce

Hit canCompleteSwap Rest and manually corrupt the path.

Expected behavior

NPEs should be handled, it should return true in this case as well.

Additional context

Add any other context about the problem here.

主要言語
Java
スター
505
フォーク
258
平均マージ
4日 20時間
マージ済み PR(30日)
3

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

apache/helix のほかの issue

apache/helix の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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