Repository navigation
Restore MQTT communication after broker restarts - #103
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Problem
A broker restart leaves the existing MQTT client disconnected indefinitely: the four-string constructor disabled Paho automatic reconnect and registered no recovery callback. Restarting a service manually is not recovery.
Change
Own one cancellable recovery task with 1–60 second backoff. Restore bounded desired subscriptions (topic, QoS, original listener) after connection or SUBACK failure. Explicit disconnect stops recovery; reconnect permits reuse; terminal close releases Paho and the owned executor. MqttHandler's terminal disconnect closes both executors. A late CONNECT cannot resurrect a stopped transport.
Existing constructors, publish APIs, clean-session behavior, topic and payload formats remain compatible. Disconnected publishes still fail: existing durable owners retry them. MQTT/QoS is not transactional exactly-once reward execution; VotingPlugin's stable vote IDs and receipts retain that responsibility.
Validation
mvn -B -f SimpleAPI/pom.xml clean package: 430 tests plus two full-artifact and one shared-artifact checks passed, 2m18s.MCHT finding:
20261001T013742829677Z-8713aa34d655. Focused exact-candidate MCHT verification remains pending active-run coordination; no full matrix or exactly-once integration result is claimed.Release order: publish SimpleAPI, rebuild AdvancedCore and VotingPlugin so the shaded MQTT implementation is actually updated.