Commits
- Commit:
db67adb16ce4aa1a633aa5320579cc0710be2b940f58e974291ec91d7ba1b58d- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
rip out all snowflake code that was grossly over simplified
Remove all the code, but set aside for future, other-daemon implementation. The
snowflake setup for 'other' bridges is far more complex than I remembered. This
strips us down to a working, robust broker.
- Commit:
34b8eb419037662cb828555a0bd980240ca0e8ffeaf1d6cf181b5e66ee07294d- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
fix whitespace
- Commit:
ae64a69f3c5275451c8383cc8b390fbeb5175f1aa77e3d1bc85c678cb9466763- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
let a snowflake sink act as the sparkplug b primary host
A snowflake block takes an optional "primary host" id, defaulting to
the sink's name. While the sink's virtual connection is up the broker
keeps a retained spBv1.0/STATE/<id> message with online true; when the
sink goes down, or the daemon stops cleanly, it is replaced by online
false carrying the same timestamp, as the specification asks of a
host's will.
An edge node configured with a Primary Host ID, such as Ignition MQTT
Transmission, publishes nothing until it sees that message and stores
and forwards while the host is offline. Without it the sink never saw
a birth.
- Commit:
b8519ffa73911b2294da61966f7c242b056d591f4d45f93a070429155c4a765d- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
import ROADMAP.md and update README.md
- Commit:
05867825afa7e5332e28ab224a39dbc9424bc5fc79fca965142619832a172f1d- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
describe worker count and congestion in mqttctl.8
"show parent" now reports the number of sockets workers and "show
clients" marks a connection that is not draining as congested and counts
the messages dropped for it; say so in the manual.
- Commit:
1ac677f7e995bd41b12d494c275059d6da7299509971ca2589b898cfc7b7ba57- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
start under a dedicated login class
Every client connection costs one descriptor in one sockets worker, and
each process raises its open file soft limit to the hard limit of the
login class the rc script started it under. Until now that was the
stock daemon class, so client capacity was whatever its default
happened to be. Ship /etc/login.conf.d/mqttd, start the daemon under
that class from the rc script, and document the sizing rule: about
workers times the class maximum, with kern.maxfiles raised to match.
- Commit:
4af73d3b7ab2f607d9116ad9e5691ded0d1b2112520a501a03ccffd085f95015- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
per-connection backpressure for slow subscribers
A sockets worker now tells the broker when the bytes queued for a
connection pass the maximum packet size, and again when they have
drained. While a connection is congested the broker drops QoS 0 for it,
counting the drop against the session and the broker totals, and parks
QoS 1 and 2 in the session queue under the existing "max queued" limit;
delivery resumes on drain. Retained messages owed to a new subscription
are still written, as [MQTT-3.3.1-9] requires.
Until now a subscriber that stopped reading accumulated output until the
worker cut it off at four times the packet size. For a Sparkplug
primary host that disconnect means a reconnect and a fleet-wide rebirth,
so the broker now sheds load per connection first; the overflow
disconnect stays as the last resort. "mqttctl show clients" shows the
congested state and the per-client drop count.
- Commit:
a8f2d00fef2add0808aaaa76f2e20c7662f8d08d3b7aa4e4162b54d6ca6764cc- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
split accept into a listen process and sockets workers
A new listen process owns the listening sockets. It accepts, consumes
the PROXY protocol header where a listener expects one, dials outbound
bridges, and hands every connected descriptor to the sockets worker with
the fewest live connections. The workers only ever receive connected
descriptors, so they run under pledge "stdio recvfd" and never call
socket(2), accept(2) or connect(2). Connection ids are global, listener
connection counts and "mqttctl show listeners" come from one process,
and bridges are no longer pinned to a process at configuration time.
"workers" in mqttd.conf sets the pool size (default 2, maximum 32);
"prefork" stays as a deprecated alias. The broker keeps one pipe per
worker and still routes by the pipe a connection arrived on.
A listener added on reload reaches the workers before listen starts
accepting on it, and a worker sets a listener's TLS context up on first
use in case a hand-off still overtakes the parent's start message.
- Commit:
8507d3d5b7832bfe03b50521368f4829ceb782586ac8e40398196e724caec3de- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
run a single sockets process
Drop the prefork pool of sockets processes. Connections are long-lived,
so balancing them once at accept() across N processes by kernel lottery
never rebalanced anything, and every listener-scoped fact (per-listener
connection counts, bridge placement, mqttctl show listeners) had to be
summed over N. The parent, broker and control each talk to one sockets
pipe now. "prefork" in mqttd.conf is still parsed and logs a
deprecation warning. The broker keeps its per-process routing index so
the coming listen/worker split does not touch it again.
- Commit:
605bf9f121de8fbec15a7e6f15f1060ed29ee16c831b7597f4a351afa5806a3a- From:
- Tracey Emery <tracey@openbsd.org>
- Date:
Initial import
