Fix actor ID collision in local mode (#5863)

* Fixed local mode actor id

* Update python/ray/actor.py

Co-Authored-By: Edward Oakes <ed.nmi.oakes@gmail.com>

* Added hyphen to match comments

* Added tests to test_local_mode

* Helloworld

* Better test naming

* lint
This commit is contained in:
Edward Oakes
2019-10-08 13:07:42 -07:00
committed by GitHub
parent 375852af23
commit 42dd0fae96
3 changed files with 42 additions and 13 deletions
+1 -3
View File
@@ -369,9 +369,7 @@ class ActorClass(object):
# Instead, instantiate the actor locally and add it to the worker's
# dictionary
if worker.mode == ray.LOCAL_MODE:
actor_id = ActorID.of(worker.current_job_id,
worker.current_task_id,
worker.task_context.task_index + 1)
actor_id = ActorID.from_random()
worker.actors[actor_id] = meta.modified_class(
*copy.deepcopy(args), **copy.deepcopy(kwargs))
core_handle = ray._raylet.ActorHandle(