mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 17:45:08 +08:00
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:
committed by
Philipp Moritz
parent
9af8dc568a
commit
e0a340ee7e
+4
-1
@@ -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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user