Skip to content

v1.13.7

Latest

Choose a tag to compare

@alexdelprete alexdelprete released this 27 May 08:37
v1.13.7
d8e9e8b

Release v1.13.7

GitHub Downloads

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 to writer.wait_closed() in check_port() had no timeout. The OS kept the
    connection in FIN_WAIT and wait_closed() blocked until the kernel TCP timeout
    expired (~10 minutes). While blocked, the DataUpdateCoordinator could not start new
    polls and every sensor stayed unavailable.

    The cleanup call is now wrapped in asyncio.wait_for() with a 2-second timeout,
    exposed as a named constant CHECK_PORT_CLOSE_TIMEOUT. Normal closures complete in
    milliseconds; only stuck sockets ever hit the limit. Both TimeoutError and OSError
    from wait_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 running mbpoll against the hung device, which
    caused the Alfa to send RST/FIN and immediately unblocked wait_closed().

    Contributed by @M4v3r1cK87 in
    #208.
    Refs #207.

Full Changelog:
compare/v1.13.6...v1.13.7