The netconf provider maintains a concurrent map of devices to which it has opened sessions. This map is checked for the presence of a device ID before attempting to create a connection to a device.
The issue is that after checking the concurrent map the provider then continues to create a connection and while this connection is being created, but before the concurrent map is updated a mastership event may come in another attempt to create a connection is invoked.
The concurrent map is check, but since the first call is not complete the device is not yet in the map and so the second call proceeds to also create a connection.
the proposed solution is to place a Lock (based on device ID) around the code so that only one create per deviceID can proceed at a time, thus the second call will be blocked until the first completes and at that time the concurrent map will have the existing session.
|21072,5||ONOS-7920 - mutex around access to prevent reentrant creation||onos-1.14||onos||Status: MERGED||+2||+1|
|21095,1||ONOS-7920 - mutex around access to prevent reentrant creation||onos-2.0||onos||Status: MERGED||+2||+1|
|21096,1||ONOS-7920 - mutex around access to prevent reentrant creation||onos-1.15||onos||Status: MERGED||+2||+1|
|21097,1||ONOS-7920 - mutex around access to prevent reentrant creation||master||onos||Status: MERGED||+2||+1|