Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
13 changes: 10 additions & 3 deletions src/span_panel_api/mqtt/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading