resizeVolume with automigrate throws NullPointerException when the migration returns no volume

未關閉 適合新手
#14,751 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java
領域
backend, cloud

研究方向

從 resizeVolume 路徑開始,其中 volume 只有在 migrateVolume 回傳非空結果時才會由 _volsDao.findById 設定,然後閱讀呼叫 volume.getUuid() 的 try 與 catch 區塊。同樣的模式也出現在 changeOfferingForVolume 中。完成的標準是:遷移結果為空時,回傳原始的遷移錯誤,並保留原始的磁碟區參照與實際嘗試過的儲存池,且不出現 NullPointerException。承載資料中未指定測試檔案,因此請尋找現有的磁碟區調整大小或遷移測試並加以擴充。

由索引模型根據 Issue 內容生成。

描述

problem

resizeVolume with automigrate=true throws a NullPointerException when the volume has to move to another pool and migrateVolume returns no volume.

step code
migration result volume = (result != null) ? _volsDao.findById(result.getId()) : null;
error built in the try volume.getUuid() on a null volume
error built in the catch volume.getUuid() again, so the NPE escapes

migrateVolume returns null on the VM work-job path when the job result is not a volume id.

changeOfferingForVolume has the same block. It does not NPE, but its message prints volume: null and names suitableStoragePools.get(0) instead of the pool that was tried.

versions

4.22 (the same code is on main).

The steps to reproduce the bug
  1. Resize a volume attached to a VM so that its pool lacks space, with automigrate=true.
  2. Have the migrate job finish without returning a volume id.
  3. The API returns a NullPointerException instead of a migration error.
What to do about it?

Keep the original volume reference for the message, report the pool that was actually tried, and keep the migration failure as the cause.

主要語言
Java
星號
3.1k
分支
1.4k
平均合併
6 天 18 小時
30 天內合併 PR
11

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。