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

    https://github.com/apache/spark/pull/3986#discussion_r22761550
  
    --- Diff: ec2/spark_ec2.py ---
    @@ -569,15 +569,34 @@ 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 boto.exception.EC2ResponseError as e:
    +                if e.error_code == "InvalidInstanceID.NotFound":
    +                    time.sleep(0.1)
    +                else:
    +                    raise e
    +            else:
    +                break
         for slave in slave_nodes:
    -        slave.add_tag(
    -            key='Name',
    -            value='{cn}-slave-{iid}'.format(cn=cluster_name, iid=slave.id))
    +        while True:
    +            try:
    +                slave.add_tag(
    +                    key='Name',
    +                    value='{cn}-slave-{iid}'.format(cn=cluster_name, 
iid=slave.id))
    +            except boto.exception.EC2ResponseError as e:
    +                if e.error_code == "InvalidInstanceID.NotFound":
    +                    time.Sleep(0.1)
    --- End diff --
    
    Sorry for the typo. 


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