Github user GenTang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3986#discussion_r22751730
  
    --- 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 --
    
    I think that it takes some time for EC2 to return an instance not existing 
exception . That's why I leave pass in the exception. However, Maybe we should 
add a small wait time to ensure that we don't submit too much requests to ec2
    
    Yes, Here we just want to catch the exception of instance not existing. You 
are right, it is better to use specific exception. I will work on this.
    



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

Reply via email to