Skip to content

Commit

Permalink
Revert "Remove linear backoff."
Browse files Browse the repository at this point in the history
This reverts commit adb4eaa and
increases the wait interval to 5 seconds.
  • Loading branch information
nchammas committed Nov 29, 2014
1 parent ef3ca99 commit efb29e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,11 @@ def wait_for_cluster_state(conn, opts, cluster_instances, cluster_state):

start_time = datetime.now()

num_attempts = 0
conn = ec2.connect_to_region(opts.region)

while True:
time.sleep(5) # seconds
time.sleep(5 * num_attempts) # seconds

for i in cluster_instances:
i.update()
Expand All @@ -687,13 +690,14 @@ def wait_for_cluster_state(conn, opts, cluster_instances, cluster_state):
if all(i.state == cluster_state for i in cluster_instances):
break

num_attempts += 1

sys.stdout.write(".")
sys.stdout.flush()

sys.stdout.write("\n")

end_time = datetime.now()

print "Cluster is now in '{s}' state. Waited {t} seconds.".format(
s=cluster_state,
t=(end_time - start_time).seconds
Expand Down

0 comments on commit efb29e1

Please sign in to comment.