-
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
Automatic Retry Logic During Connection (DBus) #1220
Comments
I think this is a good idea. There have been quite a few reports lately of getting an So rather than a general retry mechanism, I think we should handle these specific errors as needed. |
I'd been keen to help with the effort. I think tracking and handling "automatic retries" separately in each backend is probably a good idea. I would suggest that this ticket is specific to the |
Does this mean you will make a pull request? |
Yeah, I'll put something together when I have some time. |
Since BlueZ 6.62, BlueZ has a new connection error "le-connection-abort-by-local" that is seen quite frequently, particularly when there are many BLE devices in the area. Reconnecting immediately after receiving this error is generally successful, so we add an automatic retry in the BleakClient. This is a bit tricky because the device does actually connect in this case and we receive D-Bus property changes indicating this, so we have to be careful about waiting for the disconnect event before trying again. Fixes: #1220
Since BlueZ 6.62, BlueZ has a new connection error "le-connection-abort-by-local" that is seen quite frequently, particularly when there are many BLE devices in the area. Reconnecting immediately after receiving this error is generally successful, so we add an automatic retry in the BleakClient. This is a bit tricky because the device does actually connect in this case and we receive D-Bus property changes indicating this, so we have to be careful about waiting for the disconnect event before trying again. Fixes: #1220
Since BlueZ 6.62, BlueZ has a new connection error "le-connection-abort-by-local" that is seen quite frequently, particularly when there are many BLE devices in the area. Reconnecting immediately after receiving this error is generally successful, so we add an automatic retry in the BleakClient. This is a bit tricky because the device does actually connect in this case and we receive D-Bus property changes indicating this, so we have to be careful about waiting for the disconnect event before trying again. Fixes: #1220
bluetoothctl -v
) in case of Linux: 5.64Description
It might be worthwhile to have a handler in the library that allows retrying. For example, on rare occasion I may get a
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] le-connection-abort-by-local
exception. Re-connecting will work. This is a DBus specific problem, I understand... However, it would be ideal to have some sort ofretry
connection logic baked in. Thoughts on this?The text was updated successfully, but these errors were encountered: