Making abort job synchronous to avoid scenarios where kill is received before job update lock is released.

This commit is contained in:
Renan DelValle 2019-01-12 14:04:04 -08:00
parent 10c620de7b
commit 1ec4e6b39b
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
2 changed files with 52 additions and 24 deletions

View file

@ -786,7 +786,16 @@ func (r *realisClient) AbortJobUpdate(updateKey aurora.JobUpdateKey, message str
if retryErr != nil {
return nil, errors.Wrap(retryErr, "Error sending AbortJobUpdate command to Aurora Scheduler")
}
return resp, nil
// Make this call synchronous by blocking until it job has successfully transitioned to aborted
m := Monitor{Client: r}
_, err := m.JobUpdateStatus(updateKey, map[aurora.JobUpdateStatus]bool{aurora.JobUpdateStatus_ABORTED:true},time.Second * 5, time.Minute)
if err != nil {
return resp, err
} else {
return resp, nil
}
}
//Pause Job Update. UpdateID is returned from StartJobUpdate or the Aurora web UI.