AWS Quota Exceeded Infinite Retry #760
Labels
Status: Available
No one has claimed responsibility for resolving this issue.
Type: Question
A query or clarification.
We run a number of IOT devices that use AWS IOT Core for the MQTT Message Broker.
An issue came up where we were using many GBs of cellular upload data per day!! Luckily this only occurred in specific cases but this could have been catastrophic for us.
The cause of this was AWS's quota limit of 128kb per message. AWS returns a DISCONNECT message when it receives a message exceeding the quota. The problem with this is that when you set the QOS to 1 and don't clean the session, paho.mqtt retries any unacknowledged messages on disconnect... So here we were sending messages that were larger than the limit every ~3 seconds infinitely (or until the devices were restarted).
We have found a quick solution which is to always check the size of the message before trying to send the message, and to add this to the
on_disconnect
function:Maybe there is a better way to handle this in the package? It is a gotcha with some potentially dire consequences.
Hopefully this helps someone in the future.
The text was updated successfully, but these errors were encountered: