diff --git a/CHANGELOG.md b/CHANGELOG.md index 892585b..625ab93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.6.2] - 04/2026 + +### Changed + +- **Reconnect loop log noise reduced** — `SpanMqttClient._reconnect_loop` now splits the catch-all exception handler in two: expected transient failures (`OSError` family — refused connection, DNS miss, socket timeout, `ssl.SSLError`) log a one-line + WARNING with the exception repr, while unexpected exceptions retain the full traceback via `exc_info=True`. The common "panel offline" case no longer buries logs in paho/stdlib stack frames that add no diagnostic signal; genuinely unknown failures still + surface full tracebacks for support-ticket triage. + ## [2.6.1] - 04/2026 ### Changed diff --git a/pyproject.toml b/pyproject.toml index 261160b..2a66bed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "span-panel-api" -version = "2.6.1" +version = "2.6.2" description = "A client library for SPAN Panel API" authors = [ {name = "SpanPanel"} diff --git a/src/span_panel_api/mqtt/connection.py b/src/span_panel_api/mqtt/connection.py index bea9df9..6b581e7 100644 --- a/src/span_panel_api/mqtt/connection.py +++ b/src/span_panel_api/mqtt/connection.py @@ -407,10 +407,17 @@ async def _reconnect_loop(self) -> None: self._client.on_socket_open = self._on_socket_open_sync self._client.on_socket_register_write = self._on_socket_register_write_sync await self._loop.run_in_executor(None, self._client.reconnect) + except (OSError, TimeoutError) as exc: + # Expected transient failures — panel offline, DNS miss, socket + # timeout, refused connection. The exception type and errno are + # the full diagnostic; paho/stdlib stack frames add no signal. + # ssl.SSLError is an OSError subclass and falls in here too; + # SSL misconfiguration would have failed at setup, so a + # reconnect-time SSL error is handled as a transient failure. + _LOGGER.warning("Reconnect failed (%s), retrying in %ss", exc, delay) except Exception: # pylint: disable=broad-exception-caught - # paho can raise OSError, socket.gaierror, WebsocketConnectionError, - # ssl.SSLError, and others depending on transport. Never let the - # reconnect loop die — just log and keep backing off. + # Unknown territory — keep the traceback so support tickets + # are actionable. Never let the reconnect loop die. _LOGGER.warning("Reconnect failed, retrying in %ss", delay, exc_info=True) finally: if self._client is not None: diff --git a/uv.lock b/uv.lock index 08a204f..c9fdd0f 100644 --- a/uv.lock +++ b/uv.lock @@ -1310,7 +1310,7 @@ wheels = [ [[package]] name = "span-panel-api" -version = "2.6.1" +version = "2.6.2" source = { editable = "." } dependencies = [ { name = "httpx" },