wolfMQTT broker: ordering, persistence, offline queue, AES-GCM at rest#538
Open
dgarske wants to merge 8 commits into
Open
wolfMQTT broker: ordering, persistence, offline queue, AES-GCM at rest#538dgarske wants to merge 8 commits into
dgarske wants to merge 8 commits into
Conversation
…scriptions, retained messages, schema-wipe-on-mismatch, static-memory restore)
… NS_OUTQ persist, v5 Session Expiry Interval)
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds opt-in features to the wolfMQTT broker: per-subscriber outbound queueing with v5 Receive Maximum honoring, a hook-based persistence layer with a default POSIX backend, an offline message queue surviving reconnects/restarts, and optional AES-GCM encryption at rest. Also fixes a v5 CONNACK protocol error (Maximum QoS=2 was illegal).
Changes:
- New per-subscriber outbound queue / ordering / inflight cap in
mqtt_broker.c. - New persistence layer (
mqtt_broker_persist.c,mqtt_broker_persist_posix.c) with schema-wipe-on-mismatch and optional AES-GCM. - New configure flags, broker.test cases, and CI matrix entries.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfmqtt/mqtt_broker.h | Public types/macros for outbound queue, orphan sessions, persistence hooks. |
| src/mqtt_broker.c | Outbound queue, orphan session pool, persist shadow-write call sites, CONNACK fix. |
| src/mqtt_broker_persist.c | Record encoders/decoders, restore, schema wipe, AES-GCM wrap/unwrap. |
| src/mqtt_broker_persist_posix.c | Default POSIX file-based backend (kv_put/get/del/iter/sync). |
| src/include.am | Build the new persistence sources into the broker binary. |
| scripts/broker.test | New tests: ordering burst, persist round-trip, schema wipe, offline queue, AES-GCM. |
| configure.ac | --enable-broker-persist and --enable-broker-persist-encrypt flags. |
| .github/workflows/broker-check.yml | CI matrix entries for the new build configurations. |
Comments suppressed due to low confidence (1)
src/mqtt_broker.c:1
- The iterator advance
sub = sub->nextis now inside#ifndef WOLFMQTT_STATIC_MEMORY. This is presumably correct because the static-memory loop uses indexed iteration, but the asymmetry (and the fact that the dynamic-mode body lives just above the#ifndefand is already inside the linked-list loop) makes this very fragile to future edits. Consider keeping thesub = sub->nextadvance outside the orphan-handling guard, or refactoring so the loop structure is single-version per memory mode.
/* mqtt_broker.c
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When broker.test fails, the autotools test-suite.log only shows the test-runner's last few lines, not the per-test broker/sub/pub logs created under $TMPDIR/tmp.XXXXXX. Expand the "Show logs on failure" step to walk both $TMPDIR/tmp.* and /tmp/tmp.* and cat every .log, and upload the same set as a build artifact so the failure on the macos-latest ARM runner can be diagnosed off-line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MQTT_CODE_CONTINUEhandling