mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
drivers: set -1 exit code in case executor gets killed (#25453)
Nomad driver handles incorrectly set exit code 0 in case of executor failure. This corrects that behavior. --------- Co-authored-by: Tim Gross <tgross@hashicorp.com>
This commit is contained in:
committed by
GitHub
parent
b3f28f9387
commit
cb8f4ea452
@@ -604,6 +604,12 @@ func (d *Driver) handleWait(ctx context.Context, handle *taskHandle, ch chan *dr
|
||||
result = &drivers.ExitResult{
|
||||
Err: fmt.Errorf("executor: error waiting on process: %v", err),
|
||||
}
|
||||
// if process state is nil, we've probably been killed, so return a reasonable
|
||||
// exit state to the handlers
|
||||
if ps == nil {
|
||||
result.ExitCode = -1
|
||||
result.OOMKilled = false
|
||||
}
|
||||
} else {
|
||||
result = &drivers.ExitResult{
|
||||
ExitCode: ps.ExitCode,
|
||||
|
||||
Reference in New Issue
Block a user