resources: aws: ec2: Retry on exceeded wait attempts error
The waiters now return the AwsErr error "ResourceNotReady: exceeded wait attempts" when the instance state does not converge after 40 retries. During longpollWatch() we need to detect this error and continue to the top of the loop so we can restart the waiters and keep watching for events.
This commit is contained in:
committed by
James Shubin
parent
08e7caea6b
commit
149a2188e2
@@ -471,6 +471,9 @@ func (obj *AwsEc2Res) longpollWatch() error {
|
|||||||
if aerr.Code() == request.CanceledErrorCode {
|
if aerr.Code() == request.CanceledErrorCode {
|
||||||
log.Printf("%s: Request cancelled", obj)
|
log.Printf("%s: Request cancelled", obj)
|
||||||
}
|
}
|
||||||
|
if aerr.Code() == request.WaiterResourceNotReadyErrorCode {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case obj.awsChan <- &chanStruct{
|
case obj.awsChan <- &chanStruct{
|
||||||
@@ -546,6 +549,9 @@ func (obj *AwsEc2Res) longpollWatch() error {
|
|||||||
if aerr.Code() == request.CanceledErrorCode {
|
if aerr.Code() == request.CanceledErrorCode {
|
||||||
log.Printf("%s: Request cancelled", obj)
|
log.Printf("%s: Request cancelled", obj)
|
||||||
}
|
}
|
||||||
|
if aerr.Code() == request.WaiterResourceNotReadyErrorCode {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case obj.awsChan <- &chanStruct{
|
case obj.awsChan <- &chanStruct{
|
||||||
@@ -586,6 +592,9 @@ func (obj *AwsEc2Res) longpollWatch() error {
|
|||||||
if aerr.Code() == request.CanceledErrorCode {
|
if aerr.Code() == request.CanceledErrorCode {
|
||||||
log.Printf("%s: Request cancelled", obj)
|
log.Printf("%s: Request cancelled", obj)
|
||||||
}
|
}
|
||||||
|
if aerr.Code() == request.WaiterResourceNotReadyErrorCode {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case obj.awsChan <- &chanStruct{
|
case obj.awsChan <- &chanStruct{
|
||||||
|
|||||||
Reference in New Issue
Block a user