mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Move gRPC calls outside of Raylet stats lock (#6090)
This commit is contained in:
parent
e312f3d282
commit
82be14f943
1 changed files with 8 additions and 7 deletions
|
@ -404,14 +404,15 @@ class RayletStats(threading.Thread):
|
|||
counter = 0
|
||||
while True:
|
||||
time.sleep(1.0)
|
||||
replies = {}
|
||||
for node in self.nodes:
|
||||
node_id = node["NodeID"]
|
||||
stub = self.stubs[node_id]
|
||||
reply = stub.GetNodeStats(node_manager_pb2.NodeStatsRequest())
|
||||
replies[node["NodeManagerAddress"]] = reply
|
||||
with self._raylet_stats_lock:
|
||||
for node in self.nodes:
|
||||
node_id = node["NodeID"]
|
||||
stub = self.stubs[node_id]
|
||||
reply = stub.GetNodeStats(
|
||||
node_manager_pb2.NodeStatsRequest())
|
||||
self._raylet_stats[node[
|
||||
"NodeManagerAddress"]] = MessageToDict(reply)
|
||||
for address, reply in replies.items():
|
||||
self._raylet_stats[address] = MessageToDict(reply)
|
||||
counter += 1
|
||||
# From time to time, check if new nodes have joined the cluster
|
||||
# and update self.nodes
|
||||
|
|
Loading…
Add table
Reference in a new issue