Commit bad92e87 authored by Paul Rich's avatar Paul Rich
Browse files

Adding in RLock for nodes for the idle detection loop.

Make sure that an update cannot change this list midflight for a job.

Caller also holds this lock at this point in time.  The node_lock must
be reentrant!
parent e98d1429
...@@ -721,9 +721,10 @@ class CraySystem(BaseSystem): ...@@ -721,9 +721,10 @@ class CraySystem(BaseSystem):
node_id_list = [] node_id_list = []
if not requested_loc_in_forbidden: if not requested_loc_in_forbidden:
raise ValueError("forbidden locations not in queue") raise ValueError("forbidden locations not in queue")
for node_id in node_id_list: #strip non-idle nodes. with self._node_lock:
if not self.nodes[str(node_id)].status in ['idle']: for node_id in node_id_list: #strip non-idle nodes.
unavailable_nodes.append(node_id) if not self.nodes[str(node_id)].status in ['idle']:
unavailable_nodes.append(node_id)
for node_id in set(unavailable_nodes): for node_id in set(unavailable_nodes):
node_id_list.remove(node_id) node_id_list.remove(node_id)
idle_nodecount = len(node_id_list) idle_nodecount = len(node_id_list)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment