Skip to content

Commit efb29e1

Browse files
committed
Revert "Remove linear backoff."
This reverts commit adb4eaa and increases the wait interval to 5 seconds.
1 parent ef3ca99 commit efb29e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ec2/spark_ec2.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,11 @@ def wait_for_cluster_state(conn, opts, cluster_instances, cluster_state):
669669

670670
start_time = datetime.now()
671671

672+
num_attempts = 0
673+
conn = ec2.connect_to_region(opts.region)
674+
672675
while True:
673-
time.sleep(5) # seconds
676+
time.sleep(5 * num_attempts) # seconds
674677

675678
for i in cluster_instances:
676679
i.update()
@@ -687,13 +690,14 @@ def wait_for_cluster_state(conn, opts, cluster_instances, cluster_state):
687690
if all(i.state == cluster_state for i in cluster_instances):
688691
break
689692

693+
num_attempts += 1
694+
690695
sys.stdout.write(".")
691696
sys.stdout.flush()
692697

693698
sys.stdout.write("\n")
694699

695700
end_time = datetime.now()
696-
697701
print "Cluster is now in '{s}' state. Waited {t} seconds.".format(
698702
s=cluster_state,
699703
t=(end_time - start_time).seconds

0 commit comments

Comments
 (0)