Bogus out of memory report on client disconnection
If a client publishes a message using QoS=1 and disconnects before the broker can send the PUBACK, mosquitto will print something like Client auto-8F57B354-93D8-2D3B-CDF4-1340A9256762 disconnected due to out of memory. I believe this is misleading.
Though it's time dependent and might require a few retries before manifesting, it can be reproduced using the following python snippet:
import paho.mqtt.client as paho
client = paho.Client(callback_api_version=2)
client.connect('localhost')
s = client.socket()
client._send_publish(1, b'hello', b'world', 1)
s.close()
client.loop_stop()
On my computer it happens about 90% of the time (there's no way to guarantee that the python script will disconnect before the broker sends the PUBACK).
Found it in 2.0.20 and the develop branch (as a side note, I'm struggling to build latest develop).
There's likely a "return 1" somewhere that needs to be updated to a more meaningful return code
Thanks for the script, this is now fixed and will be in 2.0.22