MCPcopy Index your code
hub / github.com/firecracker-microvm/firecracker-containerd / monitorExit

Method monitorExit

internal/vm/task.go:290–312  ·  view source on GitHub ↗
(proc *vmProc, taskService taskAPI.TaskService)

Source from the content-addressed store, hash-verified

288}
289
290func (m *taskManager) monitorExit(proc *vmProc, taskService taskAPI.TaskService) {
291 waitResp, waitErr := taskService.Wait(proc.ctx, &taskAPI.WaitRequest{
292 ID: proc.taskID,
293 ExecID: proc.execID,
294 })
295
296 // Since the process is no longer running, cancel the context to
297 // free the corresponding vmProc.
298 proc.cancel()
299
300 if waitErr == context.Canceled {
301 return
302 }
303
304 if waitErr != nil {
305 proc.logger.WithError(waitErr).Error("error waiting for exit")
306 } else {
307 proc.logger.
308 WithField("exit_status", waitResp.ExitStatus).
309 WithField("exited_at", waitResp.ExitedAt).
310 Info("exited")
311 }
312}
313
314func (m *taskManager) IsProxyOpen(taskID, execID string) (bool, error) {
315 m.mu.Lock()

Callers 2

CreateTaskMethod · 0.95
ExecProcessMethod · 0.95

Calls 2

ErrorMethod · 0.80
WaitMethod · 0.45

Tested by

no test coverage detected