restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)

オープン 初心者向け
#14,631 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

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

調査の方向性

RestartNetworkCmd.execute()を読み、その例外処理を、issueで参照例として示されているRestartVPCCmd.execute()と比較してください。NetworkService.restartNetwork()で宣言されている例外を確認し、レポートに記載された対応するエラーマッピングを追ってください。両方の再起動コマンドで、同じ失敗が一貫したAPIエラーコードと想定されるログレベルになることが完了条件です。

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

説明

problem

A restartNetwork that fails with a ResourceUnavailableException is reported as an unexpected error, while the same failure from restartVPC is not.

RestartNetworkCmd.execute() doesn't catch the checked exceptions that NetworkService.restartNetwork() declares, so they reach ApiAsyncJobDispatcher. The dispatcher logs anything that isn't a ServerApiException at ERROR as Unexpected exception while executing ... RestartNetworkCmd, with a stack trace, and fails the job with error code 530.

RestartVPCCmd.execute() catches the same exceptions and maps them to ServerApiException: ResourceUnavailableException gives 534 at WARN, ConcurrentOperationException 530 and InsufficientCapacityException 533. API clients therefore see a different error code for the same condition depending on whether the network is in a VPC, and the management server log shows an ERROR for an expected refusal.

versions

4.22 (the code is the same on main).

The steps to reproduce the bug
  1. Make a network restart fail with a ResourceUnavailableException. For example, stop the CloudStack agent on the host that runs the network's router, so that the commands to the router fail with AgentUnavailableException, and call restartNetwork on that network.
  2. The async job fails with error code 530, and the management server logs Unexpected exception while executing org.apache.cloudstack.api.command.user.network.RestartNetworkCmd at ERROR.
  3. Do the same with restartVPC on a VPC: the job fails with 534, and the exception is logged at WARN.
What to do about it?

Catch the exceptions in RestartNetworkCmd.execute() the way RestartVPCCmd.execute() does.

主要言語
Java
スター
3.1k
フォーク
1.4k
平均マージ
6日 20時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

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

apache/cloudstack のほかの issue

apache/cloudstack の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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