mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
[rpc] refactor GRPC client (#6637)
* refactor RPC client * remove unused code * format * fix * resolve comments * format * update * fix * fix python pb build failure * lint
This commit is contained in:
@@ -454,7 +454,7 @@ class RayletStats(threading.Thread):
|
||||
node_id = node["NodeID"]
|
||||
stub = self.stubs[node_id]
|
||||
reply = stub.GetNodeStats(
|
||||
node_manager_pb2.NodeStatsRequest(), timeout=2)
|
||||
node_manager_pb2.GetNodeStatsRequest(), timeout=2)
|
||||
replies[node["NodeManagerAddress"]] = reply
|
||||
with self._raylet_stats_lock:
|
||||
for address, reply in replies.items():
|
||||
|
||||
@@ -860,7 +860,7 @@ def stat(address):
|
||||
channel = grpc.insecure_channel(raylet_address)
|
||||
stub = node_manager_pb2_grpc.NodeManagerServiceStub(channel)
|
||||
reply = stub.GetNodeStats(
|
||||
node_manager_pb2.NodeStatsRequest(), timeout=2.0)
|
||||
node_manager_pb2.GetNodeStatsRequest(), timeout=2.0)
|
||||
print(reply)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def test_worker_stats(shutdown_only):
|
||||
for _ in range(num_retry):
|
||||
try:
|
||||
reply = stub.GetNodeStats(
|
||||
node_manager_pb2.NodeStatsRequest(), timeout=timeout)
|
||||
node_manager_pb2.GetNodeStatsRequest(), timeout=timeout)
|
||||
break
|
||||
except grpc.RpcError:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user