WaitUntilNetworkInterfaceAvailableWithContext does not block with InvalidNetworkInterfaceID.NotFound error
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [x] I've gone though Developer Guide and API reference
- [x] I've checked AWS Forums and StackOverflow for answers
- [x] I've searched for previous similar issues and didn't find any solution
Describe the bug
Invoking WaitUntilNetworkInterfaceAvailableWithContext with a non existing Network ID
returns immediately with an error. The same happens in cases that Network is not available (e.g. right after the CreateNetworkInterface invocation). I would expect that WaitUntilNetworkInterfaceAvailableWithContext blocks for a period of time (10 attempts * 20" by default) until it fails with a ResourceNotReady error.
Currently the error returned is InvalidNetworkInterfaceID.NotFound.
Version of AWS SDK for Go? 1.42.9
Version of Go (go version)?
go version go1.17.3 darwin/amd64
To Reproduce (observed behavior)
someID := "eni-1234567890"
err = e.svc.WaitUntilNetworkInterfaceAvailableWithContext(aws.BackgroundContext(),
&ec2.DescribeNetworkInterfacesInput{
NetworkInterfaceIds: []*string{
&someID,
},
})
if err != nil {
log.Error("Network interface ", someID, " did not become available after creation. Err: ", err)
return nil, err
}
Expected behavior
In the code presented above, I would expect having the WaitUntilNetworkInterfaceAvailableWithContext to block the execution for the whole period of the polling time (10 attempts * 20") as the Network is not found (as it has not even created). But instead of this, it immediately returns an error with type InvalidNetworkInterfaceID.NotFound.
Additional context
The same issue affects the WaitUntilNetworkInterfaceAvailable which directly invokes the WaitUntilNetworkInterfaceAvailableWithContext.
The possible solution to this is to remove the acceptor
{
"expected": "InvalidNetworkInterfaceID.NotFound",
"matcher": "error",
"state": "failure"
}
from the WaitUntilNetworkInterfaceAvailableWithContext acceptors.
I have prepared a branch with the required change
but it requires changes to the models/apis/ec2/2016-11-15/waiters-2.json which, based on the guidelines requires to open an issue first instead of a PR.
Hi, is this still persisting with the latest version of SDK?
Hi @vudh1 , the issue is still persisting with the latest version of the SDK. Currently it is at https://github.com/aws/aws-sdk-go/blob/main/service/ec2/waiters.go#L990 Release v1.44.4 (2022-04-29).