Race using EC2.Instance method wait_until_running()
See original GitHub issueThe EC2.Waiter says everything is ok but it’s fibbing, the instance is not in-fact running but still pending. I’m not sure if this is because an instance object probably shouldn’t be calling wait_until_running on itself or an actual race with describe_instances maybe.
print ('Waiting until instance is running')
instance.wait_until_running(
Filters=[
{
'Name': 'instance-id',
'Values': [instance.instance_id],
}
]
)
print (instance.state)
{'Name': 'pending', 'Code': 0}
Should be running.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
EC2: Waiting until a new instance is in running state
This method calls EC2.Waiter.instance_running.wait() which polls EC2.Client.describe_instances() every 15 seconds until a successful state is ...
Read more >Creating wait conditions in a template - AWS CloudFormation
Typically, you want a wait condition to begin immediately after the creation of a specific resource, such as an Amazon EC2 instance, RDS...
Read more >Keep calm and race on: a redux-saga case study
First, we have the polling request that starts running asynchronously. Now, at any point in time while this request is running, the user...
Read more >EC2 slow cloud-init, Ansible SSH connection fails due to race ...
So the SSH port open check is not good enough to detect and wait for the port to ... My question is: Has...
Read more >Top 10 most common Java performance problems
Our application environment was actually pretty heavy-duty for the time. We had a Cisco load balancer in front of four WebLogic instances running...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m deep into the rabbit hole now. But I seriously cannot find any working example of wait_until_running(). Only a lot of stray single line comments, none of which work, some of which recommend using a while loop to manually wait instead. This is bad, there should be at least one working example in documentation.
I haven’t done this in a while but I think it’s important to understand that the method is named
wait_until_running
. It implies that some form of polling or check is part of the method and it is likely to continue to mislead people unfortunately.