Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Patience added when creating placement groups #161

Closed
wants to merge 2 commits into from

2 participants

@FinchPowers

This fix prevents the "Placement doesn't exist" error.

@jtriley jtriley closed this pull request from a commit
@jtriley awsutils: fix 'placement group DNE' errors
In some cases fetching the placement group object immediately after
it's been created returns a DNE error due to a race condition in the EC2
API back-end. Updated EasyEC2.create_placement_group to avoid this issue
by waiting until the new placement group can successfully be refetched
via EasyEC2.get_placement_group_or_none before returning the new
placement group to the caller.

closes gh-161
7919a85
@jtriley jtriley closed this in 7919a85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2012
  1. @FinchPowers
Commits on Dec 20, 2012
  1. @FinchPowers

    Simplified the wait

    FinchPowers authored
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +10 −0 starcluster/awsutils.py
View
10 starcluster/awsutils.py
@@ -278,6 +278,16 @@ def create_placement_group(self, name):
(name, success))
raise exception.AWSError(
"failed to create placement group '%s'" % name)
+
+ while 1:
+ #wait for it to propagate within EC2
+ try:
+ self.conn.get_all_placement_groups(groupnames=name)
+ break
+ except:
+ log.info("Still waiting for placement group " + name)
+ time.sleep(10)
+
return self.get_placement_group(name)
def get_placement_groups(self, filters=None):
Something went wrong with that request. Please try again.