don't destruct worker object before all of the object references go out of scope (#212)

This commit is contained in:
Robert Nishihara
2016-07-05 19:13:57 -07:00
committed by Philipp Moritz
parent 58b65d39a9
commit 8297522580
2 changed files with 25 additions and 13 deletions
+7 -7
View File
@@ -39,6 +39,13 @@ def new_objstore_port():
return 20000 + objstore_port_counter
def cleanup():
global drivers
for driver in drivers:
ray.disconnect(driver)
if len(drivers) == 0:
ray.disconnect()
drivers = []
global all_processes
for p, address in all_processes:
if p.poll() is not None: # process has already terminated
@@ -59,13 +66,6 @@ def cleanup():
print "Termination attempt failed, giving up."
all_processes = []
global drivers
for driver in drivers:
ray.disconnect(driver)
if len(drivers) == 0:
ray.disconnect()
drivers = []
# atexit.register(cleanup)
def start_scheduler(scheduler_address):