Skip to content
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

Connections to the Firecracker unix socket are never closed #368

Open
yitsushi opened this issue Nov 24, 2021 · 0 comments
Open

Connections to the Firecracker unix socket are never closed #368

yitsushi opened this issue Nov 24, 2021 · 0 comments

Comments

@yitsushi
Copy link

yitsushi commented Nov 24, 2021

When we call the API to see what's the status of the MicroVM, the connection stays there and it's never closed (only when we restart the application).

Here is an isolated demonstration: https://github.com/yitsushi/firecracker-go-sdk-connection-leak-poc

Sample code:

func callAPI() {
	fcClient := client.NewHTTPClient(strfmt.NewFormats())
	logger := logrus.NewEntry(logrus.New())

	socketPath := "/tmp/firecracker.socket"
	transport := firecracker.NewUnixSocketTransport(
		socketPath,
		logger,
		true,
	)

	fcClient.SetTransport(transport)

	resp, err := fcClient.Operations.DescribeInstance(
		operations.NewDescribeInstanceParams(),
	)
	if err != nil {
		logrus.Error(err.Error())

		return
	}

	logrus.
		WithField("state", *resp.Payload.State).
		Info("Firecracker API response")
}

In the demo (link above) we are using github.com/firecracker-microvm/firecracker-go-sdk v0.22.0.

It's a very painful behavior because

  1. We have unused resources in the system piling up
  2. Firecracker limitations on the connection pool and we are hitting 503 errors

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant