Allow actors to pin at most 1000 dummy objects at a time. (#1241)

* Allow actors to pin at most 1000 dummy objects at a time.

* Fix linting.
This commit is contained in:
Robert Nishihara
2017-11-22 13:38:01 -08:00
committed by Philipp Moritz
parent 9af8dc568a
commit e0a340ee7e
5 changed files with 20 additions and 2 deletions
+4 -1
View File
@@ -134,7 +134,10 @@ def put_dummy_object(worker, dummy_object_id):
# actor, to prevent eviction from the object store.
dummy_object = worker.get_object([dummy_object_id])
dummy_object = dummy_object[0]
worker.actor_pinned_objects[dummy_object_id] = dummy_object
worker.actor_pinned_objects.append(dummy_object)
if (len(worker.actor_pinned_objects) >
ray._config.actor_max_dummy_objects()):
worker.actor_pinned_objects.pop(0)
def make_actor_method_executor(worker, method_name, method):
+1 -1
View File
@@ -1836,7 +1836,7 @@ def connect(info, object_id_seed=None, mode=WORKER_MODE, worker=global_worker,
worker.class_id = class_id
# Store a list of the dummy outputs produced by actor tasks, to pin the
# dummy outputs in the object store.
worker.actor_pinned_objects = {}
worker.actor_pinned_objects = []
# Initialize the serialization library. This registers some classes, and so
# it must be run before we export all of the cached remote functions.