Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Race using EC2.Instance method wait_until_running()

See original GitHub issue

The 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')
                            'Name': 'instance-id',
                            'Values': [instance.instance_id],

print (instance.state)
{'Name': 'pending', 'Code': 0}

Should be running.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

jesper-bylundcommented, Mar 28, 2019

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.

cwarner-mdsolcommented, Mar 31, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found