firecracker-microvm / firecracker-microvm/firecracker-go-sdk

Firecracker socket resets connection on shutdown

Open
#228 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
672
Forks
166
PR merge metrics
No merged PRs in 30d

Description

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.

```
Unable to send CtrlAltDel: Put "http://localhost/actions": read unix @->/run/firecracker.socket: read: connection reset by peer component=microvm-0
DEBU[2020-04-21T20:20:32] instance Destroy() component="microvm-0 (867e7d58)" error="Put \"http://localhost/actions\": read unix @->/run/firecracker.socket: read: connection reset by peer"
INFO[2020-04-21T20:20:32] Finished shutdown of VMM component=vmm
WARN[2020-04-21T20:20:33] firecracker exited: signal: interrupt component=microvm-0
DEBU[2020-04-21T20:20:33] closing the exitCh 1 error occurred:
* signal: interrupt
component=microvm-0
```
However when I try using the same kernel image with `firectl`, I am able to cleanly shutdown using the curl command to the firecracker socket

```
ps aux | grep firecracker
sriramv+ 12276 7.4 0.5 530096 40892 pts/0 Sl+ 00:57 0:05 /usr/local/bin/firecracker --api-sock /home/sriramvenkat/.firecracker.sock-12268-81
sriramv+ 12366 0.0 0.0 112712 976 pts/1 S+ 00:58 0:00 grep --color=auto firecracker
[sriramvenkat@containedwaned ~]$ curl --unix-socket /home/sriramvenkat/.firecracker.sock-12268-81 -i -X PUT "http://localhost/actions" -H "accept: application/json" -H "Content-Type: application/json" -d "{
> \"action_type\": \"SendCtrlAltDel\"
> }"
HTTP/1.1 204
Server: Firecracker API
Connection: keep-alive
[sriramvenkat@containedwaned ~]$ ps aux | grep firecracker
sriramv+ 12276 5.3 0.5 530100 40892 pts/0 Sl+ 00:57 0:05 /usr/local/bin/firecracker --api-sock /home/sriramvenkat/.firecracker.sock-12268-81
sriramv+ 12391 0.0 0.0 112712 976 pts/1 S+ 00:59 0:00 grep --color=auto firecracker
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.