-
Notifications
You must be signed in to change notification settings - Fork 125
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
Firecracker socket resets connection on shutdown #228
Comments
What is the configuration of your Linux kernel? Shutdown internally uses SendCtrlDel, which is not supported by some Linux kernels. See firecracker-microvm/firecracker#1095 for the detail. |
@sriramsv Do you still see this issue? |
I am experiencing the same behaviour as described here. Running the above curl command against the socket causes a reboot and a clean shutdown:
When using the SDK and calling Shutdown(), I see:
In the guest, I see no new output on the serial console. firecracker.Machine
// Shutdown requests a clean shutdown of the VM by sending CtrlAltDelete on the virtual keyboard
func (m *Machine) Shutdown(ctx context.Context) error {
m.logger.Debug("Called machine.Shutdown()")
return m.sendCtrlAltDel(ctx)
} For some reason, there have been no SDK releases since Sept 2022, but I've tried using that and the latest commit in the main branch. I got the same results in either case. Firecracker v1.7.0 |
@swagatbora90 would you have any suggestions here? I saw you'd made commits into the SDK repository recently, feel free to ping someone else if needed. |
It seems like the bug is potentially a regression with signal passing, since when I invoke the same codepath through an internal HTTP endpoint, the shutdown method works as expected. When I run control + c on the controller program, the signal appears to be propagated directly to Firecracker causing it to exit immediately meaning it's unable to handle the HTTP request. I overrode the list of signals to make sure that nothing that would cause a termination would get passed through and can see that in the Go SDK:
The debug logs show that this signal propagation is faulty, despite only being configured to send through USR1, the control + c went to the Firecracker process and terminated it before the controller could clean it up.
|
When you press Ctrl+C in the terminal, it sends the signal to all processes in the current process group rather than just a single process. I think the Go SDK would need to allow spawning firecracker/jailer processes with |
That's a fair point, and what we eventually found out too. Thanks for commenting. |
while trying out the
machine.Shutdown()
call from the go-sdk, the firecracker socket resets the connection and also shuts down the VM disgracefully due to the error.I also used the new
ForwardSignals
set to[]os.Signal{}
to make sure firecracker does not listen to any interrupt signals coming from the host operating system.However when I try using the same kernel image with
firectl
, I am able to cleanly shutdown using the curl command to the firecracker socketThe text was updated successfully, but these errors were encountered: