-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
out of memory crash + disconnection in exit of context manager when using qos=2 (paho 1.3.1) #250
Comments
|
Aha! qos=2 is a no-go for MQTT for specific reasons:
I think that closes part of the issue (but the crash should not happen) in fact, the MQTT plugin could maybe issue big fat warnings on any QoS=2 use encountered, rather than let users find out? (but it is indeed documented on the top of the MQTT plugin doc page). |
Thank for your patience and report detailed report. RabbitMQ don't like QoS=2 package, but on my quick test (docker run rabbitmq, then rabbitmq-plugins enable rabbitmq_mqtt) I don't reproduce an out of memory. The client only get disconnected as soon as it publish the message and reconnect (in loop). Which is expected if the broker don't support them :) I will try to test you Vagrant file in the next days. |
indeed, that seems to be what is happening (disconnect + reconnect, but including an out-of-memory error) |
Are you saying you have out of memory because the disconnect error is "Out of memory." ? This come from paho.mqtt.python/src/paho/mqtt/client.py Line 1794 in e9914a7
So except for a wrong error message, there is no other issue. |
did you try the Vagrant approach? I crafted it specially, the README explains the steps to reproduce the issue. why does a disconnection happens? it looks like qos=2 is not correctly dealt with. |
What I reproduce is RabbitMQ closing the connection (because it don't support QoS=2). On the client side I don't see any bad behavior (except the message / return code which is not the good one). That why I asked if the "Out of memory" come only from the error_string(result). If that the case, the only issue on paho side is that a return 1 is used for a generic error, but MQTT_ERR_NOMEM also have the value 1. Paho should be updated to return a most useful error. Paho can't do anything better with QoS=2 and RabbitMQ, the broker don't support it and you should either use only QoS < 2 or use another broker. |
At least issue from by commit 332834e |
I think so, yes, thanks for flagging this. |
for some dark reason, an out of memory error + disconnection occurs when publishing a qos=2 message.
I've created a small Vagrant VM that runs a RabbitMQ config and a client that attempts to send such a message: https://github.com/axd1967/paho-bug
the bug seems to happen upon exit of a context manager in publish() in paho/mqtt/client.py(1121):
paho.mqtt.python/src/paho/mqtt/client.py
Line 1121 in e9914a7
(note: code simplified, I can successfully send qos=0 and qos=1 messages via RabbitMQ)
paho-mqtt (1.3.1) , Ubuntu 16
The text was updated successfully, but these errors were encountered: