Status: accepted Date: 2026-10-05 Deciders: GoBridge core Amends: 0020 (a settlement recovery that fails after its drain, and a pre-decode ingress reject, are contained in the session instead of latching it closed; every fault this record does not name keeps the 0020 unit rebuild) Relates to: 0018 (the unit rebuild that a lease-managed session, exclusive with a lease store, can still get is an in-place reload of one reload unit), 0011 (the ingress-reject backoff uses the same stability window as the session-takeover damping and is added to the reconnect delay the same way)
ADR 0020 contains an MQTT session that latched the permanent marker
shared.ErrTransportClosedPermanently: the composition root rebuilds the reload
unit that holds the session. That is a heavy answer. Every receiver, sender,
binding and route joined to the session stops and is built again, after the
per-session rebuild backoff (1 s doubling to 30 s, with equal jitter, so the
first wait lies between 0.5 s and 1 s). ADR 0020 left the transport side of
two of its MQTT faults unchanged and deferred it to a record of its own. This
is that record.
Both faults are contained in the paho session. The session does not go
terminal and emits no SessionError. ADR 0020 still applies when an abandoned
recovery leaves a lease-managed session with no connection, and when a step of
the recovery fails closed in a way that is terminal outside a recovery too.
clean_start=false), whatever clean_start is set to. When the CONNACK
answers Session Present = false, the session records the loss exactly as it
does after an ordinary reconnect: MQTTSessionResumeLost counts it, a Warn
log names it, and the resume-lost error stays on SessionHealth.LastError
until the next successful reconcile clears it. The recovery goes on, and its
reconcile re-subscribes. While a recovery is requested this holds for every
connect, even one that this configuration would not otherwise expect to
resume.abandonRecoveryAttempt), unless the step that failed has already latched
the session terminal (see the list of terminal failures below):
settlementRecoveryMinInterval): the next
recovery waits until 30 s after this one ended. The session logs Warn
mqtt: settlement recovery abandoned after its drain; the session reconnects normally.Reconcile on it, as it does after any
reconnect.Start is in flight, and the session is
not closed. The session closes its events channel. That is the ordinary
signal of a dead session. What follows depends on whether the session is a
lease-managed session: exclusive, in a runtime with a lease store
(Manager.Exclusive).
Start
re-creates the events channel and connects.Start on the
closed session fails with shared.ErrTransportClosedPermanently, the
manager ends with ErrSessionUnrecoverable, and the unit is rebuilt
(ADR 0020). With connect_after_lease (the default for a route source)
that Start runs only after this node holds the lease again, so the
rebuild waits until then.Start is in flight. The Start owns the signal. If it fails, its
caller gets the error and the manager runs the session again. If it
succeeds, its SessionConnected reaches the manager.failClosedAfterQuiescence), or when the broker pins a delivery
for a removed filter and no dead-letter store takes it
(failClosedForManagedMigration). abandonRecoveryAttempt then finds the
session terminal and does nothing.In those cases route work, or a delivery the broker pinned to the session,
may still act, so the session latches shared.ErrTransportClosedPermanently.
sync.Locker Paho serialises its writes through.
When a Paho write holds that lock, the guard skips the DISCONNECT and only
closes the socket, which also unblocks that write; the broker then sees the
connection drop with no reason code. Otherwise the DISCONNECT write has a 1 s
deadline.MQTTIngressRejected counts it, tagged session_id.
MQTTRouterDropped does not count it;SessionHealth.LastError.reconnect_delay × 2^(streak − 1), capped at
reconnect_max_delay;The delay is added to autopaho’s own backoff, the same way the session-takeover penalty is (ADR 0011).
Ready false and
ServiceLevel None. The reject stays active until a connection that came up
after the last reject has stayed up for 30 s (connectionStabilityWindow,
which the takeover damping also uses). Once a connection has held that long, the next reject starts a new streak, and the
reject is forgotten at the next connection-down or planned teardown: a
Reload, a disconnect, or Close.A session latches terminal so that old route work cannot act after the session is replaced. ADR 0020 relies on two guarantees for that. Both still hold.
MQTTSessionResumeLost), as on an ordinary reconnect. The broker-side
backlog for the client_id, including the delivery the recovery wanted
redelivered, is gone with the broker session. A rebuild could not bring it
back either.MQTTIngressRejected
(MQTT ingress poison).Reconcile fails, and the manager
treats it like any failed reconcile on reconnect. A session without a lease
is run again (SessionRestarts) and keeps its reject streak, so its reject
backoff keeps growing. A lease-managed session is closed, releases its lease
after the settlement grace and gets the ADR 0020 unit rebuild
(SessionRebuilds); a standby may take the lease and hit the same packet.
The rebuilt session starts with no reject streak, so the ADR 0020 rebuild
backoff paces these rebuilds, and the ADR 0020 known risk — a unit rebuilt
again and again — still applies to it.