-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Consider the following situation:
Where both PersistentHeartbeat devices are configured to the same address (e.g.: 0), but named differently. For example HB1 and HB2 respectively.
As it is expected it throws an error on the HB2 node, since addresses are duplicated:
If after this situation we remove the duplication and leave only a node called HB1 (or anything else), the workflow would work. But if we named the node HB2 (or, specifically, the name that the node that threw the duplicate address exception had), then we get this same error, even if it is the only configure node trying to access this address.
I am pretty sure the issue lays inside this check:
| if (info.Context == deviceInfo.Context && info.DeviceAddress == deviceInfo.DeviceAddress) |
Which throws an exception whenever there is a duplicate address. However, this block does not call dispose on the element created on
| var disposable = RegisterDevice(name); |
which causes the name of the offending node to be stuck on the dictionary, not being clean.
I am pretty sure simply calling disposable.Dispose() before the throw should clean the object and remove it from the dictionary. But I am writing this report just in case.