I notice that the intended behavior is to attempt to re-open a device 10 times and return an error if the USB context can not be reopened. However, the actual behavior is an infinite loop of trying to reopen the context. This PR prevents that infinite loop from happening and appropriately exits and logs after 10 tries. I encountered this code path on my own device and had to manually send Ctrl-C to retry the activation.
I notice that the intended behavior is to attempt to re-open a device 10 times and return an error if the USB context can not be reopened. However, the actual behavior is an infinite loop of trying to reopen the context. This PR prevents that infinite loop from happening and appropriately exits and logs after 10 tries. I encountered this code path on my own device and had to manually send Ctrl-C to retry the activation.