-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kill Firecracker if SendCtrlAltDel failed #177
Kill Firecracker if SendCtrlAltDel failed #177
Conversation
Firecracker on arm machines does not support the SendCtrlAltDel action and luckily it throws back an error instead of silently does nothing. Why lucky? That way if the SendCtrlAltDel failed, we can rety to kill it with a graceful SIGINT signal and if it did not work, we can throw back an error and say "we did what we could". Error message from Firecracker: {"fault_message":"SendCtrlAltDel does not supported on aarch64."} Fixes liquidmetal-dev#152
if errors.Is(err, &url.Error{}) { | ||
logger.Info("microvm is not running") | ||
} else if pid, pidErr := vmState.PID(); pidErr != nil { | ||
logger.Infof("sending SIGINT to %d", pid) | ||
|
||
if sigErr := process.SendSignal(pid, os.Interrupt); sigErr != nil { | ||
return fmt.Errorf("failed to create halt action: %w", err) | ||
} | ||
} else { | ||
return fmt.Errorf("failed to create halt action: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am slightly worried that this section could become a bit unwieldy the more error/check variations we add... but happy to leave it until we actually see it happening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in both cases the result is the same, failed delete and the wrapped error will tell why.
Codecov Report
@@ Coverage Diff @@
## main #177 +/- ##
==========================================
+ Coverage 47.00% 54.16% +7.16%
==========================================
Files 45 45
Lines 1951 1968 +17
==========================================
+ Hits 917 1066 +149
+ Misses 930 795 -135
- Partials 104 107 +3
Continue to review full report at Codecov.
|
What this PR does / why we need it:
Firecracker on arm machines does not support the SendCtrlAltDel action
and luckily it throws back an error instead of silently does nothing.
Why lucky? That way if the SendCtrlAltDel failed, we can rety to kill it
with a graceful SIGINT signal and if it did not work, we can throw back
an error and say "we did what we could".
Error message from Firecracker:
Which issue(s) this PR fixes:
Fixes #152
Checklist: