Release v1.13.7
Release Date: 2026-05-27
Type: Patch release - Fixes a hang in the TCP port reachability check that could
keep the integration stuck for ~10 minutes after a device hard reset.
What's Changed
Fixed
-
check_port()no longer hangs after a device hard reset - When the Alfa device
reset abruptly without sending a TCP FIN (typically on a watchdog reboot), the cleanup
call towriter.wait_closed()incheck_port()had no timeout. The OS kept the
connection inFIN_WAITandwait_closed()blocked until the kernel TCP timeout
expired (~10 minutes). While blocked, theDataUpdateCoordinatorcould not start new
polls and every sensor stayedunavailable.The cleanup call is now wrapped in
asyncio.wait_for()with a 2-second timeout,
exposed as a named constantCHECK_PORT_CLOSE_TIMEOUT. Normal closures complete in
milliseconds; only stuck sockets ever hit the limit. BothTimeoutErrorandOSError
fromwait_closed()are logged at debug level and swallowed, since the port itself
was already proven reachable.Hard-reset recovery time drops from 10+ minutes to 2-3 minutes (limited only by the
device warm-up gate introduced in v1.13.5).Root cause matches the behaviour described in the Python
asyncio.StreamWriter
documentation:wait_closed()may block indefinitely if the peer never closes the
connection. Empirically confirmed by runningmbpollagainst the hung device, which
caused the Alfa to sendRST/FINand immediately unblockedwait_closed().Contributed by @M4v3r1cK87 in
#208.
Refs #207.
Full Changelog:
compare/v1.13.6...v1.13.7