[deviceauth] possible race condition when decommissioning device
Description
The deviceauth service synchronizes device data with inventory.
The data synchronization is done asynchronously.
The decommissioning of the device is also done by asynchronous job.
It is possible to have a race condition where one job is removing the device from some services and the other job is adding it back. The end result can be that the device will be present in the inventory, but not in the deviceauth, which is wrong by itself, but it’s also causing some other issues - e.g. it impossible to decommission the device.
The deviceauth service synchronizes device data with inventory.
The data synchronization is done asynchronously.
The decommissioning of the device is also done by asynchronous job.
It is possible to have a race condition where one job is removing the device from some services and the other job is adding it back. The end result can be that the device will be present in the inventory, but not in the deviceauth, which is wrong by itself, but it’s also causing some other issues - e.g. it impossible to decommission the device.