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

    https://github.com/apache/spark/pull/5109#discussion_r27143511
  
    --- Diff: ec2/spark_ec2.py ---
    @@ -567,16 +592,28 @@ def launch_cluster(conn, opts, cluster_name):
                     for i in my_req_ids:
                         if i in id_to_req and id_to_req[i].state == "active":
                             
active_instance_ids.append(id_to_req[i].instance_id)
    -                if len(active_instance_ids) == opts.slaves:
    -                    print "All %d slaves granted" % opts.slaves
    +                if len(active_instance_ids) == len(my_req_ids):
    +                    if opts.master_spot_price is not None:
    +                        if opts.spot_price is not None:
    +                            print "Master and all %d slaves granted" % 
opts.slaves
    +                        else:
    +                            print "Master granted"
    +                    else:
    +                        print "All %d slaves granted" % opts.slaves
                         reservations = 
conn.get_all_reservations(active_instance_ids)
    +                    master_nodes = []
                         slave_nodes = []
                         for r in reservations:
    -                        slave_nodes += r.instances
    +                        if any([group.name == cluster_name + "-master" for 
group in r.groups]):
    +                            master_nodes += r.instances
    +                        elif any([group.name == cluster_name + "-slaves" 
for group in r.groups]):
    +                            slave_nodes += r.instances
    +                        else:
    +                            print >> stderr, ("WARNING: Unknown security 
group " % group.name)
    --- End diff --
    
    I guess this case is possible because we are looking at the reservations 
for the whole account.
    
    Wouldn't it be better if we reused the master and slave reservations 
directly? i.e. `master_reqs` and `slave_reqs` from a few lines above.
    
    Then we don't have to go through all the reservations on the account like 
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