-
Notifications
You must be signed in to change notification settings - Fork 2k
Handle error case when no instances returned after calling AWS RunInstances #4747
base: master
Are you sure you want to change the base?
Conversation
|
Please sign your commits following these rules: $ git clone -b "patch-1" [email protected]:elliotrushton/machine.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
Handle the error case that can arise when requests to run new AWS instances returns no errors but an empty struct of results. Signed-off-by: erushton <[email protected]>
|
I'm really hoping this change is accepted. My organization keeps running into this issue using docker-machine on AWS t3-medium instances. A fix would save time and lots of money! |
|
It seems at least one other place needs to be changed. EC2 DescribeInstances call can return empty reservation set when waiting for instance ip (called from |
|
Please accept the PR. This bug is eating money for a lot of organisations! |
|
this is the code for a lamda function we are using that stops us losing any more money until the bug is fixed (it's very simple if a instance is started of the type we use for runners and it doesn't get a tag within a few minutes terminate the instance) node 10 const AWS = require('aws-sdk'); const delay = async () => { const terminate = async (ec2InstanceId) => { const instanceType = async (ec2InstanceId) => { const tags = async (ec2InstanceId) => { exports.handler = async (event) => { this is the event pattern we trigger on |
Description
Handles the error case that can arise when requests to run new AWS instances returns no errors but an empty struct of results.
Fixes #4746 - where there's an unhandled case where calls to AWS RunInstances returns an empty list of reservations and no error, which results in a panic and leaves half-created resources.
This PR fixes the problem in a similar way to how this case is handled in Deploy Kit https://github.com/docker/deploykit/blob/master/pkg/provider/aws/plugin/instance/ec2_instance.go#L272
Related issue(s)
#4746