Commit 6c534b9c authored by Dario Ernst's avatar Dario Ernst Committed by oroulet

Delete datachange_callbacks only on copy of dict to delete them from

Deleting a node on which any client holds a datachange-notification
subscription, NodeManagementService._delete_node_callbacks fails because
the size of the dictionary it loops over changes. Here, we solve this by
not using the .items() iterator, but making a copy in form of a list
first ….
parent 4309dafd
......@@ -335,7 +335,7 @@ class NodeManagementService(object):
def _delete_node_callbacks(self, nodedata):
if ua.AttributeIds.Value in nodedata.attributes:
for handle, callback in nodedata.attributes[ua.AttributeIds.Value].datachange_callbacks.items():
for handle, callback in list(nodedata.attributes[ua.AttributeIds.Value].datachange_callbacks.items()):
try:
callback(handle, None, ua.StatusCode(ua.StatusCodes.BadNodeIdUnknown))
self._aspace.delete_datachange_callback(handle)
......
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