-
Notifications
You must be signed in to change notification settings - Fork 302
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
fix BlueZ wait condition disconnect race #1399
Conversation
87460b9
to
147b4e3
Compare
Updated:
|
@bdraco let me know if you want to test before merging |
Will give it a shot shortly |
This makes sure all methods of the BlueZManager are checking that the adapter or device exists in BlueZ before continuing with the method. Documentation is updated to indicate which functions have this check and which do not.
…es_discovery() This adds a 3rd race condition to _wait_for_services_discovery() to handle the case where an interface is removed from BlueZ without changing the "Connected" property. This can happen, e.g. when we hit "retry due to le-connection-abort-by-local".
This adds a device path key to the condition callbacks. This will avoid calling callbacks for other devices that are not the subject of the current "PropertiesChanged" signal.
147b4e3
to
edfbd93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, could not replicate race after this PR.
Note: it took days of testing on the other one to be sure so I can't be 100% but this seems good.
Ran overnight frequent polling. Didn't notice the safety timeout ever kicking in anymore. Could be just luck but I think its solved |
Running for almost 48 hours now and no more safety timeouts. I think this is solved 👍 |
Thanks @dlech |
Thanks for testing! |
Alternative to #1329 and #1377.
@bdraco could you please take a look?
The issue addressed by #1377 seems more widespread, so I took it a bit farther to make sure it is fixed in all public functions (first commit).
Instead of synthesizing a
"Connected"
property change as proposed in #1329, here I have opted to just add a 3rd race condition on"InterfacesRemoved"
when waiting for services to be resolved (second commit).