handle execve error as fatal

This commit is contained in:
criyle 2019-09-15 15:10:16 -07:00
parent dcbc99fa5d
commit 9898c301d5
2 changed files with 7 additions and 1 deletions

View File

@ -70,9 +70,14 @@ func (m *Master) Execve(done <-chan struct{}, param *ExecveParam) (<-chan types.
// done signal (should recv after kill)
m.recvReply()
// emit result after all communication finish
status := reply2.Status
if reply2.Error != "" {
status = types.StatusFatal
}
wait <- types.Result{
ExitStatus: reply2.ExitStatus,
Status: reply2.Status,
Status: status,
Error: reply2.Error,
}
}()
// Kill (if wait is done, a kill message need to be send to collect zombies)

View File

@ -6,6 +6,7 @@ import "time"
type Result struct {
Status // the final status for the process
ExitStatus int // exit Status
Error string // potential detailed error message
UserTime uint64 // used user CPU time (in ms)
UserMem uint64 // used user memory (in kb)
Stat // collects time usage for the runner