vmm: api: Be more specific on "Still pending remove vcpu" errors by fidencio · Pull Request #7043 · cloud-hypervisor/cloud-hypervisor · GitHub
Skip to content

vmm: api: Be more specific on "Still pending remove vcpu" errors#7043

Merged
likebreath merged 3 commits intocloud-hypervisor:mainfrom
fidencio:topic/return-too-many-requests-if-cpu-removal-is-still-pending
Apr 28, 2025
Merged

vmm: api: Be more specific on "Still pending remove vcpu" errors#7043
likebreath merged 3 commits intocloud-hypervisor:mainfrom
fidencio:topic/return-too-many-requests-if-cpu-removal-is-still-pending

Conversation

@fidencio
Copy link
Copy Markdown
Member

@fidencio fidencio commented Apr 25, 2025

Although the CPU manager gives us a quite descriptive error, on the application side (the part calling Cloud Hypervisor) we have absolutely no way to distinguish such error from any other error that may happen when resizing a VM.

With this in mind, let's be more specific and return a TooManyRequests (429) error, allowing the caller to have a chance to decide whether they want to retry the operation or not.

Note: We're bumping micro-http as the TooManyRequests status code had to be added there first.

https://datatracker.ietf.org/doc/html/rfc6585#section-4

@fidencio fidencio requested a review from a team as a code owner April 25, 2025 12:40
@fidencio fidencio force-pushed the topic/return-too-many-requests-if-cpu-removal-is-still-pending branch 5 times, most recently from 651baaf to aa7ba76 Compare April 25, 2025 14:05
Copy link
Copy Markdown
Member

@likebreath likebreath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fidencio Thank you for the contribution. Good to have you back in the community. Some comments below.

Comment thread api_client/src/lib.rs
Comment thread Cargo.lock
Comment thread vmm/src/api/http/http_endpoint.rs Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you please keep the alphabetical order, say after VmAddNet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

As the coming patches in this series will take advantage of a status
code that was recently added there.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
Although the CPU manager gives us a quite descriptive error, on the
application side (the part calling Cloud Hypervisor) we have absolutely
no way to distinguish such error from any other error that may happen
when resizing a VM.

With this in mind, let's be more specific and return a TooManyRequests
(429) error, allowing the caller to have a chance to decide whether they
want to retry the operation or not.

https://datatracker.ietf.org/doc/html/rfc6585#section-4

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
In order to be on-pair with what's we're using from micro-http, let's
also add the proper status code here as well (as it will be used by
`ch-remote`).

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
@fidencio fidencio force-pushed the topic/return-too-many-requests-if-cpu-removal-is-still-pending branch from aa7ba76 to 6ed7e46 Compare April 25, 2025 18:24
@fidencio
Copy link
Copy Markdown
Member Author

@likebreath likebreath enabled auto-merge April 28, 2025 16:23
@likebreath likebreath added this pull request to the merge queue Apr 28, 2025
Merged via the queue into cloud-hypervisor:main with commit 1968805 Apr 28, 2025
40 checks passed
@likebreath likebreath moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants