Fix auto-converge on live migration retry - #189
Open
olivereanderson wants to merge 4 commits into
Open
Conversation
The ThrottleCommand does not need to be Clone (nor Copy) as of now and we will need to introduce a variant wrapping a type that is not Copy in a follow up commit. It is also debatable whether a message type should be Clone, as they are typically intended to be sent only once (and not used for other purposes). Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
In order to add a command for resetting the throttle thread with confirmation we have to add an additional variant that wraps a type that does not implement the PartialEq and Eq traits. We thus need to choose between manually implementing these traits for ThrottleCommand, or avoiding them. We choose the latter because that requires much less code. Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
It makes more sense for a command to use the imperative form and the enum does not need to be used to track the throttling thread's current state. This enables us to introduce a reset variant to the enum that asks the throttle thread to stop its throttle loop and inform us when it is back to waiting for the next incoming command. Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
The current behavior of joining the vCPU throttling thread towards the end of a live migration is problematic when the live migration fails because then auto-converge is no longer possible on a second attempt. We fix this by instead resetting the throttling thread to its initial state. The throttling thread is now instead gracefully stopped by the ThrottleThreadHandle's destructor which runs whenever the Vm instance goes out of scope. Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
olivereanderson
force-pushed
the
auto-converge-retry
branch
from
August 3, 2026 15:10
b13edd0 to
04f57d3
Compare
olivereanderson
marked this pull request as ready for review
August 3, 2026 17:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/cobaltcore-dev/cobaltcore/issues/642.
We may want to consider just spawning the throttling thread per live migration attempt instead, but since we might very well replace auto-converge with post-copy in the not too distant feature it might not be worth investing too much time in perfecting this now.
The existing libvirt test suite seems to pass on this branch: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/267, but it would be nice to include an additional test for this particular case.