daemon: removed unused variable in sdt code and update to avoid deadlock when deleting nodes due to sdt trying to leverage the same lock on reconnect

This commit is contained in:
Blake Harnden 2020-12-16 21:32:47 -08:00
parent 4ec9ea7b16
commit 2e77907d72
2 changed files with 4 additions and 3 deletions

View file

@ -1129,13 +1129,16 @@ class Session:
"""
Clear the nodes dictionary, and call shutdown for each node.
"""
nodes_ids = []
with self.nodes_lock:
funcs = []
while self.nodes:
_, node = self.nodes.popitem()
self.sdt.delete_node(node.id)
nodes_ids.append(node.id)
funcs.append((node.shutdown, [], {}))
utils.threadpool(funcs)
for node_id in nodes_ids:
self.sdt.delete_node(node_id)
def write_nodes(self) -> None:
"""