mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
handle execve error as fatal
This commit is contained in:
parent
dcbc99fa5d
commit
9898c301d5
@ -70,9 +70,14 @@ func (m *Master) Execve(done <-chan struct{}, param *ExecveParam) (<-chan types.
|
|||||||
// done signal (should recv after kill)
|
// done signal (should recv after kill)
|
||||||
m.recvReply()
|
m.recvReply()
|
||||||
// emit result after all communication finish
|
// emit result after all communication finish
|
||||||
|
status := reply2.Status
|
||||||
|
if reply2.Error != "" {
|
||||||
|
status = types.StatusFatal
|
||||||
|
}
|
||||||
wait <- types.Result{
|
wait <- types.Result{
|
||||||
ExitStatus: reply2.ExitStatus,
|
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)
|
// Kill (if wait is done, a kill message need to be send to collect zombies)
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import "time"
|
|||||||
type Result struct {
|
type Result struct {
|
||||||
Status // the final status for the process
|
Status // the final status for the process
|
||||||
ExitStatus int // exit Status
|
ExitStatus int // exit Status
|
||||||
|
Error string // potential detailed error message
|
||||||
UserTime uint64 // used user CPU time (in ms)
|
UserTime uint64 // used user CPU time (in ms)
|
||||||
UserMem uint64 // used user memory (in kb)
|
UserMem uint64 // used user memory (in kb)
|
||||||
Stat // collects time usage for the runner
|
Stat // collects time usage for the runner
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user