Github user nchammas commented on a diff in the pull request:
https://github.com/apache/spark/pull/3986#discussion_r22750816
--- Diff: ec2/spark_ec2.py ---
@@ -569,15 +569,28 @@ def launch_cluster(conn, opts, cluster_name):
master_nodes = master_res.instances
print "Launched master in %s, regid = %s" % (zone, master_res.id)
- # Give the instances descriptive names
+ # Give the instances descriptive names.
+ # The code of handling exceptions corresponds to issue [SPARK-4983]
for master in master_nodes:
- master.add_tag(
- key='Name',
- value='{cn}-master-{iid}'.format(cn=cluster_name,
iid=master.id))
+ while True:
+ try:
+ master.add_tag(
+ key='Name',
+ value='{cn}-master-{iid}'.format(cn=cluster_name,
iid=master.id))
+ except:
+ pass
--- End diff --
Would it make sense to insert a small wait here? Say, 0.1 seconds.
Otherwise, if it takes even a second for the information about the new instance
to propagate, we might spam EC2 with requests very quickly and get rate limited.
Also, can we catch the exception specific to an instance not existing? We
don't want to catch other exceptions here, right?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]