Repository navigation
Log MQTT packets dropped while a broker is down - #31
Merged
Merged
Conversation
Packets are still not buffered, but a warning now marks when a broker starts dropping them and the count is logged once publishing resumes. Two silent paths: a job reaching a nil or never-connected client, and a QoS 0 publish while paho auto-reconnects, where IsConnected stays true and paho completes the token without sending or storing it. Drop and count both in doPublish. QoS 1 status publishes still go to paho, which stores them across a reconnect.
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.
Packets heard while an MQTT broker is down were dropped without a word. They are still dropped (no buffer), but now logged: one warning when a broker starts dropping, and
broker publishing again dropped=Nwhen it recovers.Found during the joint on-air test: MQTT rows ran exactly 1 short of
recv, because a packet heard in the half-second before the first connect was dropped silently (behaviour since fa0bc45).Two silent paths, both now counted in
doPublishIsConnected()stays true while it auto-reconnects, and a QoS 0 publish then completes its token without being sent or stored. The first version of this fix missed it; running the real binary caught it. Packet rows are now dropped and counted whenIsConnectionOpen()is false.Testing
dropped=27dropped=30-race.