Addressing feedback. Monitors now return errors which provide context through behavior. Adding notes to the doc explaining what happens when AbortJob times out.

This commit is contained in:
Renan DelValle 2019-01-14 15:32:47 -08:00
parent e90eeaf2b4
commit 6183c5a375
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3 changed files with 29 additions and 31 deletions

View file

@ -775,6 +775,8 @@ func (r *realisClient) StartJobUpdate(updateJob *UpdateJob, message string) (*au
}
// Abort Job Update on Aurora. Requires the updateId which can be obtained on the Aurora web UI.
// This API is meant to be synchronous. It will attempt to wait until the update transitions to the aborted state.
// However, if the job update does not transition to the ABORT state an error will be returned.
func (r *realisClient) AbortJobUpdate(updateKey aurora.JobUpdateKey, message string) (*aurora.Response, error) {
r.logger.DebugPrintf("AbortJobUpdate Thrift Payload: %+v %v\n", updateKey, message)
@ -791,11 +793,7 @@ func (r *realisClient) AbortJobUpdate(updateKey aurora.JobUpdateKey, message str
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
}
return resp, err
}
//Pause Job Update. UpdateID is returned from StartJobUpdate or the Aurora web UI.