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

Add stages to the firecracker_stage_duration_usec metric #8281

Merged
merged 9 commits into from
Feb 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
close vm exec conn once
  • Loading branch information
vanja-p committed Feb 3, 2025
commit cd08f278fed2719ce91f3ecc540d762a0630c621
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,6 @@ func (c *FirecrackerContainer) LoadSnapshot(ctx context.Context) error {
if err != nil {
return err
}
defer conn.Close()

execClient := vmxpb.NewExecClient(conn)
_, err = execClient.Initialize(ctx, &vmxpb.InitializeRequest{
Expand Down Expand Up @@ -1287,7 +1286,6 @@ func (c *FirecrackerContainer) createAndAttachWorkspace(ctx context.Context) err
if err != nil {
return err
}
defer conn.Close()
execClient := vmxpb.NewExecClient(conn)

workspaceExt4Path := filepath.Join(c.getChroot(), workspaceFSName)
Expand Down Expand Up @@ -2133,7 +2131,6 @@ func (c *FirecrackerContainer) Exec(ctx context.Context, cmd *repb.Command, stdi
if err != nil {
return commandutil.ErrorResult(status.InternalErrorf("Firecracker exec failed: failed to dial VM exec port: %s", err))
}
defer conn.Close()

result, vmHealthy := c.SendExecRequestToGuest(ctx, conn, cmd, guestWorkspaceMountDir, stdio)

Expand Down Expand Up @@ -2422,6 +2419,7 @@ func (c *FirecrackerContainer) Pause(ctx context.Context) error {
if c.releaseCPUs != nil {
c.releaseCPUs()
}
c.vmExec.conn.Close()
c.vmExec.once = &sync.Once{}

pauseTime := time.Since(start)
Expand Down