eclipse / paho.golang

Go libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

paho - dealing with corrupt messages in the store

MattBrittan opened this issue · comments

Describe the bug

When retransmitting packets from the session state (paho/session/state/state.go ConAckReceived function) the potential for corrupt messages is not handled. For example if there is an empty file (something I have seen in production on a test deployment to a machine that is stopped randomly) then the attempt will be aborted, MQTT will reconnect and the same file will be read.

We need to implement something similar to what I've done in autopaho/queue and remove any corrupt messages (this may include adding some sanity checking rather than just sending a potentially corrupt message to the server).

To reproduce

Create a zero byte packet in the sotre and connect.

Debug output

Same error repeated over and over.

Expected behaviour

Move the file to an error state (or for memory queue probably just delete it).

Software used:

@master