Add backoff to broker reconnection

sensor-mesh · OpenClaw · branch fix/reconnect · claude-opus-5 · cwd /home/user/code/sensor-mesh · id 39707e8f-b349-b607-c245-eb0d252d4e66 · 2026-11-08 17:54 · 2 msgs · 7 tools · 1 min read · updated 4 days ago

A dropped broker connection produced a tight reconnect loop.

tools: Read, Edit, Bash
← sensor-mesh Download .md
Tool calls
Bash Bash: 3 calls (42.9%) 3 Edit Edit: 2 calls (28.6%) 2 Read Read: 2 calls (28.6%) 2
Token usage5.0K total
Input4.2K
Cache creation0
Cache read0
Output805
Cache hit ratio0%· cold cache

Project: sensor-mesh · Branch: fix/reconnect · Mode: default · Model: claude-opus-5

Stats: 2 user messages, 7 tool calls, tools used: Read, Edit, Bash.

Conversation

Turn 1 — User

When the broker goes down the logs fill up in seconds.

Turn 1 — Assistant

The reconnect had no delay. It now backs off exponentially up to a ceiling, with jitter so a fleet coming back does not reconnect in lockstep.

The log line moved to a summary — one line per attempt with the current delay, rather than one per failure.

Tools used:

  • Read: llmwiki/mqtt_reconne.py L1–80

Tool results:

→ result (ok): (file, 120 lines)

Tools used:

  • Edit: llmwiki/sensor_mesh/handler.py

Tool results:

→ result (ok): ok — 1 hunk

Tools used:

  • Bash: python3 -m pytest tests/ -q -k mqtt_reconnect_backoff # fa19fb

Tool results:

→ result (ok): … 4 passed in 0.2s

Turn 2 — User

Does it give up eventually?

Turn 2 — Assistant

No, it keeps retrying at the ceiling. For a background collector, continuing to try is more useful than exiting and needing supervision to restart it.

Tools used:

  • Edit: llmwiki/sensor_mesh/handler.py

Tool results:

→ result (ok): ok — 1 hunk

Tools used:

  • Bash: python3 -m pytest tests/ -q -k mqtt_reconnect_backoff # 5d64f7

Tool results:

→ result (ok): … 4 passed in 0.1s

Tools used:

  • Read: llmwiki/mqtt_reconne.py L1–80

Tool results:

→ result (ok): (file, 324 lines)

Tools used:

  • Bash: rg -n farnodeck wiki/

Tool results:

→ result (ok): wiki/overview.md:14: … farnodeck …

Connections: [[Time Series]], [[Observability]].

Keyboard shortcuts

⌘K / Ctrl+KOpen command palette
/Focus search
g hGo to home
g pGo to projects
g sGo to sessions
j / kNext / prev row (tables)
?Show this help
EscClose dialogs

Structured queries

Mix key:value filters with free text in the palette:

type:sessionOnly session pages
project:llm-wikiFilter by project name (substring)
model:claudeFilter by model name (substring)
date:>2026-03-01Sessions after a date
date:<2026-04-01Sessions before a date
tags:rustPages mentioning a tag/topic
sort:dateSort results by date (newest first)

Example: type:session project:llm-wiki date:>2026-04 sort:date