Bluetooth-Devices / bleak-retry-connector

A connector for Bleak Clients that handles transient connection failures
MIT License
11 stars 2 forks source link

fix: increase bleak safety timeout to allow for longer disconnect timeout #101

Closed bdraco closed 1 year ago

bdraco commented 1 year ago

This PR is blocking https://github.com/esphome/aioesphomeapi/pull/528

We can't actually do this yet without making the connection stall problem worse since it means we would have it wait 60s (instead of 30s) between failed connection because the bleak issue where the connection attempt can stall when the device is removed from the bus (see below):

BLOCKED: Changes needed for this are merged to bleak develop, but not yet released

Merging this PR would make the following issues worse without the bleak issues being solved:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 71.42% and project coverage change: -0.32% :warning:

Comparison is base (beee26f) 78.52% compared to head (0bd6a47) 78.20%. Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #101 +/- ## ========================================== - Coverage 78.52% 78.20% -0.32% ========================================== Files 4 4 Lines 419 445 +26 Branches 95 104 +9 ========================================== + Hits 329 348 +19 - Misses 61 65 +4 - Partials 29 32 +3 ``` | [Files Changed](https://app.codecov.io/gh/Bluetooth-Devices/bleak-retry-connector/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bluetooth-Devices) | Coverage Δ | | |---|---|---| | [src/bleak\_retry\_connector/bluez.py](https://app.codecov.io/gh/Bluetooth-Devices/bleak-retry-connector/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bluetooth-Devices#diff-c3JjL2JsZWFrX3JldHJ5X2Nvbm5lY3Rvci9ibHVlei5weQ==) | `80.44% <62.50%> (-0.93%)` | :arrow_down: | | [src/bleak\_retry\_connector/\_\_init\_\_.py](https://app.codecov.io/gh/Bluetooth-Devices/bleak-retry-connector/pull/101?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Bluetooth-Devices#diff-c3JjL2JsZWFrX3JldHJ5X2Nvbm5lY3Rvci9fX2luaXRfXy5weQ==) | `77.55% <90.90%> (+0.06%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.