mirror of
https://github.com/wassname/ray.git
synced 2026-07-28 11:25:04 +08:00
don't destruct worker object before all of the object references go out of scope (#212)
This commit is contained in:
committed by
Philipp Moritz
parent
58b65d39a9
commit
8297522580
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user