From 9898c301d56664cc32fcfba37becdac00aaad623 Mon Sep 17 00:00:00 2001 From: criyle Date: Sun, 15 Sep 2019 15:10:16 -0700 Subject: [PATCH] handle execve error as fatal --- daemon/master_cmd_execve.go | 7 ++++++- types/types.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/master_cmd_execve.go b/daemon/master_cmd_execve.go index 81bb856..bad29c9 100644 --- a/daemon/master_cmd_execve.go +++ b/daemon/master_cmd_execve.go @@ -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) diff --git a/types/types.go b/types/types.go index 15d61c2..1595152 100644 --- a/types/types.go +++ b/types/types.go @@ -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