Skip to content

VolumeStatsTask NPE 방지#836

Open
dhslove wants to merge 1 commit into
ablecloud-team:ablestack-europafrom
dhslove:codex/fix-volume-stats-npe
Open

VolumeStatsTask NPE 방지#836
dhslove wants to merge 1 commit into
ablecloud-team:ablestack-europafrom
dhslove:codex/fix-volume-stats-npe

Conversation

@dhslove
Copy link
Copy Markdown

@dhslove dhslove commented May 31, 2026

요약

  • VolumeStatsTask가 볼륨 통계 수집 중 volume.getFormat() 또는 pool 메타데이터가 비어 있는 경우 NullPointerException을 반복 출력하지 않도록 보강했습니다.
  • 볼륨 format이 없는 경우에는 volume stats 수집을 debug 수준으로 skip하고, 실제 미지원 format만 기존처럼 warn으로 남기도록 정리했습니다.
  • UserVmManagerImpl#getVolumeStatistics에서도 storage pool, Up host, provider 조회 결과가 비어 있는 경합 상황을 null-safe하게 처리했습니다.

확인한 현상

  • 22.10 관리서버 로그에서 VolumeStatsTask가 약 10분 주기로 java.util.ImmutableCollections$ListN.indexOf 경유 NPE를 반복했습니다.
  • 원인은 List.of(...).contains(null) 호출이며, 실제 로그의 스택은 StatsCollector$VolumeStatsTask.runInContext에서 발생했습니다.

검증

  • mvn -pl server -Dtest=StatsCollectorTest test -DskipSurefireReport
  • mvn -pl server -DskipTests package
  • 22.10 관리서버에 변경 class hot patch 후 ServerDaemon 재시작 및 API alive 확인
  • 최종 배포 후 VolumeStatsTask NPE가 재발하지 않고 null format volume은 debug skip 로그로 처리됨을 확인

배포 메모

  • 공유 22.x 환경에는 전체 jar 교체 대신 기존 배포 jar 백업 후 변경 class만 패치했습니다.
  • cloud-server-4.22.0.0-SNAPSHOT.jarcloudstack-4.22.0.0-SNAPSHOT.jar 양쪽에 동일 class가 있어 두 jar 모두 패치가 필요했습니다.

Skip volume stats collection for volumes whose format is unavailable
instead of allowing List.of(...).contains(null) to throw. Also guard
missing pool metadata in the volume stats path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant