[live-migration] harden resume against stdio and exit wait loss - #2866
Open
Harsh Rawat (rawahars) wants to merge 3 commits into
Open
[live-migration] harden resume against stdio and exit wait loss#2866Harsh Rawat (rawahars) wants to merge 3 commits into
Harsh Rawat (rawahars) wants to merge 3 commits into
Conversation
When a live migration rolls back to the source, the VM resumes but the container's stdout/stderr were dropped during blackout and never restored, so anything watching the container's output saw it stop for good. Resume now brings those streams back the same way the destination already does, so a rolled-back container keeps streaming its output as if the migration had never been attempted. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Harsh Rawat (rawahars)
force-pushed
the
source-rollback-reconnect
branch
from
August 9, 2026 09:14
24ab7b6 to
fcd6d96
Compare
A process reopened on the destination relies on the exit wait its previous owner left outstanding in the guest. If the process exited while no bridge was connected, the guest's response to that wait was dropped and never re-sent, so the reopened process would wait for an exit that is never reported. On reopen, probe with a short bounded wait: an already-exited process returns its retained exit code immediately, while a still-running one lets the probe time out and the outstanding wait is watched as before. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Harsh Rawat (rawahars)
requested review from
Manish Ranjan Mahanta (marma-dev) and
Shreyansh Sancheti (shreyanshjain7174)
August 9, 2026 20:12
| if existing, dup := brdg.rpcs[id]; dup { | ||
| // A source rollback re-opens a process whose wait is still outstanding; | ||
| // hand back that call. | ||
| return existing, nil |
Contributor
There was a problem hiding this comment.
PreregisterRPC returns the existing call for a duplicate ID, but OpenProcessWithIO keeps the new Process.waitResp. The existing call still unmarshals into the old response object. I reproduced this on the combined #2867 + #2866 branch: completing the reused wait with exit code 42 made the new Process.ExitCode() return 0. Can we preserve the response object together with the reused call, and add that case to the test?
Contributor
Author
There was a problem hiding this comment.
Thanks for the feedback. Addressed the same in db73516
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Shreyansh Sancheti (shreyanshjain7174)
approved these changes
Aug 10, 2026
Shreyansh Sancheti (shreyanshjain7174)
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
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.
Summary
Two blackout-related gaps in live migration, each restoring behavior the connection drop had broken:
Testing
Ran
live-migrationsource rollback with a single container and with 10 containers; validated logs stream back on the source.