mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 16:40:00 +08:00
[redis-py] change redis-py deprecated hmset usage to hset (#11776)
This commit is contained in:
@@ -139,8 +139,9 @@ class FunctionActorManager:
|
||||
"remote function", self._worker)
|
||||
key = (b"RemoteFunction:" + self._worker.current_job_id.binary() + b":"
|
||||
+ remote_function._function_descriptor.function_id.binary())
|
||||
self._worker.redis_client.hmset(
|
||||
key, {
|
||||
self._worker.redis_client.hset(
|
||||
key,
|
||||
mapping={
|
||||
"job_id": self._worker.current_job_id.binary(),
|
||||
"function_id": remote_function._function_descriptor.
|
||||
function_id.binary(),
|
||||
@@ -333,7 +334,7 @@ class FunctionActorManager:
|
||||
"""
|
||||
# We set the driver ID here because it may not have been available when
|
||||
# the actor class was defined.
|
||||
self._worker.redis_client.hmset(key, actor_class_info)
|
||||
self._worker.redis_client.hset(key, mapping=actor_class_info)
|
||||
self._worker.redis_client.rpush("Exports", key)
|
||||
|
||||
def export_actor_class(self, Class, actor_creation_function_descriptor,
|
||||
|
||||
+1
-1
@@ -643,7 +643,7 @@ class Node:
|
||||
process_info,
|
||||
]
|
||||
redis_client = self.create_redis_client()
|
||||
redis_client.hmset("webui", {"url": self._webui_url})
|
||||
redis_client.hset("webui", mapping={"url": self._webui_url})
|
||||
|
||||
def start_plasma_store(self, plasma_directory, object_store_memory):
|
||||
"""Start the plasma store."""
|
||||
|
||||
@@ -359,8 +359,9 @@ class Worker:
|
||||
"function", self)
|
||||
|
||||
# Run the function on all workers.
|
||||
self.redis_client.hmset(
|
||||
key, {
|
||||
self.redis_client.hset(
|
||||
key,
|
||||
mapping={
|
||||
"job_id": self.current_job_id.binary(),
|
||||
"function_id": function_to_run_id,
|
||||
"function": pickled_function,
|
||||
@@ -368,7 +369,7 @@ class Worker:
|
||||
})
|
||||
self.redis_client.rpush("Exports", key)
|
||||
# TODO(rkn): If the worker fails after it calls setnx and before it
|
||||
# successfully completes the hmset and rpush, then the program will
|
||||
# successfully completes the hset and rpush, then the program will
|
||||
# most likely hang. This could be fixed by making these three
|
||||
# operations into a transaction (or by implementing a custom
|
||||
# command that does all three things).
|
||||
|
||||
Reference in New Issue
Block a user