Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead lock issue with DisconnectAsync() #24

Open
agardiol opened this issue Apr 4, 2024 · 6 comments
Open

Dead lock issue with DisconnectAsync() #24

agardiol opened this issue Apr 4, 2024 · 6 comments
Labels
needs-info Further information is requested question Questions and Answers

Comments

@agardiol
Copy link
Contributor

agardiol commented Apr 4, 2024

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

@DamianSuess
Copy link
Contributor

@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.

@agardiol
Copy link
Contributor Author

agardiol commented Apr 5, 2024

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).

@DamianSuess
Copy link
Contributor

Sounds good, thanks for checking with them.
Have a wonderful weekend if I don't talk with you till then

@agardiol
Copy link
Contributor Author

agardiol commented Apr 5, 2024

Thanks, you too

@5CoVK
Copy link

5CoVK commented Apr 11, 2024

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.

@DamianSuess
Copy link
Contributor

@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.

@DamianSuess DamianSuess added question Questions and Answers needs-info Further information is requested labels Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Further information is requested question Questions and Answers
Projects
None yet
Development

No branches or pull requests

3 participants