-
Notifications
You must be signed in to change notification settings - Fork 304
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
Device remains connected if connection is successful but get_services receives TimeoutError during connect #951
Comments
I don't see how this is possible. Immediately after line 152, there is a try/except block that calls How exactly is the connection failing? |
It happens after the connection timed out. I expect the its raising CanceledError but I would have expected BaseException catching would have caught that and triggered the I have not yet been able to replicate it on demand. |
So I think part of what's going on is (and this is a tricky race so I may still be missing something): Disconnected Monitor is started bleak/bleak/backends/bluezdbus/client.py Line 202 in 8515d22
bleak/bleak/backends/bluezdbus/client.py Line 205 in 8515d22
and then trapped by the BaseException so bleak/bleak/backends/bluezdbus/client.py Line 209 in 8515d22
Device completes connection in the background is is connected but we think it is not connected because the timeout was raised. The next connection attempt things are in an indeterminate state since the device is actually connected but we don't know that. |
So I think the race is that the cancel happens during Then bleak/bleak/backends/bluezdbus/client.py Line 257 in 8515d22
And set bleak/bleak/backends/bluezdbus/client.py Line 269 in 8515d22
After that the bleak/bleak/backends/bluezdbus/client.py Line 223 in 8515d22
|
And I just realized why I can't replicate it anymore. Since I have |
I noticed I was getting the callback multiple times and tracked it down to the
_remove_device_watcher
not being canceled when the connection failsbleak/bleak/backends/bluezdbus/client.py
Line 152 in 456cea8
The text was updated successfully, but these errors were encountered: