gobridge

Runbook: Broker Outage / Reconnect Storm

Applies to: any long-lived transport session (MQTT, AMQP 0-9-1, AMQP 1.0, Azure Service Bus). Audience: on-call operators. Risk: low to act — the adapters reconnect on their own; the danger is mistaking a broker outage for a bridge fault and restarting healthy tasks.

Symptom

Diagnosis

  1. Confirm connectivity separately from health. /health stays green through a broker outage; gate on the transport instead:

    curl -s "http://<host>:8081/api/v1/monitor/ready?level=connected"
    # 503 → at least one session is not connected to its broker
    

    /api/v1/monitor/deephealth (authenticated) reports per-session state (http-api-monitor.md).

  2. Read the error code to classify the cause. Every rejected CONNECT is counted on MQTTConnectFailures, tagged session_id and the bounded code, and the same cause is latched on the session’s LastError until the session comes back up — so the reason is visible without catching a log line live (troubleshooting.md):
  3. Watch the reconnect metrics under GoBridge/Runtime (monitoring.md#key-metrics): MQTTReconnects (session reconnects), ReconcileFailures (reconcile after reconnect failed), SessionRestarts (supervised per-session restart). In a clustered deployment a broker outage that outlasts the lease TTL also raises LeaseExpiries.

  4. If reconnects loop without recovering, check for MQTTSessionTakeover (troubleshooting.md#adapter–runtime-diagnostic-metrics): two instances sharing one client_id kick each other off in a loop.

  5. Check whether the outage cost you the durable session. MQTTSessionResumeLost counts every connection where a persistent or exclusive session asked the broker to resume (clean_start=false) and the CONNACK answered Session Present=false. Re-subscribing then succeeds and the session goes green again, so this counter — and the matching LastError latch, which clears on the next converged reconcile — is the ONLY evidence that continuity broke.

  6. If reconnects recover but readiness never reaches full, look for MQTTQoSDowngraded. A broker QoS cap fails every reconcile identically; the third consecutive confirmation of the same grant is treated as permanent and the session goes terminal rather than restarting into it forever.

Action