Making abort job synchronous (#95)

* Making abort job synchronous to avoid scenarios where kill is received before job update lock is released.
* Adding missing cases for terminal update statues to JobUpdate monitor.
* 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-15 14:55:59 -08:00 committed by GitHub
parent 10c620de7b
commit 2b7eb3a852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 32 deletions

View file

@ -28,6 +28,19 @@ func IsTimeout(err error) bool {
return ok && temp.Timedout()
}
type timeoutErr struct {
error
timedout bool
}
func (r *timeoutErr) Timedout() bool {
return r.timedout
}
func newTimedoutError(err error) *timeoutErr {
return &timeoutErr{error: err, timedout: true}
}
// retryErr is a superset of timeout which includes extra context
// with regards to our retry mechanism. This is done in order to make sure
// that our retry mechanism works as expected through our tests and should