Dead lock issue with DisconnectAsync()
Hello,
While using this library we have sometimes a dead lock situation while calling Device.DisconnectAsync(). We tried to ignore this by avoiding to await on this function but in this case, the dead lock occurs later while trying to force the Adapter to remove the device from it's internal list (Adapter.RemoveDeviceAsync(Device)).
It seems to be an issue related to bluez since if we kill our software and try to manually remove or disconnect the device with bluetoothctl, we get a "org.bluez.Error.Busy" (in fact each commands return this error).
Did you already see such dead lock behavior ?
Thanks by advance and best regards. Antoine
@agardiol, may I ask, if your application is doing anything else during this call to Disconnect?
I ask because the only time it happened to me was when we were performing a lot of advertisement calls in a fast-running loop and didn't stop other operations and BlueZ itself was overloaded.
Thanks for your answer. As far as I know, we did not do anything asynchronously. I will check with my colleague asap (but he is out of the office for 4 days).
Sounds good, thanks for checking with them. Have a wonderful weekend if I don't talk with you till then
Thanks, you too
Hello @DamianSuess, I am working with @agardiol and I can confirm that we make sure to avoid doing anything asynchronously during this DisconnectAsync() call.
For info, we are working on multiple Raspberry Pi 4, all with BlueZ 5.66. One thing we noticed is that it seems to happen more often on devices with the latest Linux 6.6.20 installed than on older devices with Linux 6.1.0. But we're not sure if it's really linked.
@agardiol and @5CoVK I updated the package to use the latest Tmds.DBus (v0.20).
Give it a shot and let me know if you're still running into this issue.