(proc *vmProc, taskService taskAPI.TaskService)
| 288 | } |
| 289 | |
| 290 | func (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 | |
| 314 | func (m *taskManager) IsProxyOpen(taskID, execID string) (bool, error) { |
| 315 | m.mu.Lock() |
no test coverage detected