diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b3ca4b..c0b9c077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ Given the high speed of development in the first phase, changes are being report - Fixed dashboard widgets custom classes being propagated both to the container and to the widget content [see #179] +- Added reconnection logic to `backend.mqtt` listeners in case of temporary MQTT server-side errors. + ## [0.20.6] - 2021-03-16 ### Added diff --git a/platypush/backend/mqtt.py b/platypush/backend/mqtt.py index 427d7e55..8722c2be 100644 --- a/platypush/backend/mqtt.py +++ b/platypush/backend/mqtt.py @@ -83,7 +83,7 @@ class MqttClient(mqtt.Client, threading.Thread): # noinspection PyUnusedLocal def handler(client, userdata, rc): if not self._stop_scheduled and rc in {mqtt.MQTT_ERR_INVAL, mqtt.MQTT_ERR_AGAIN, mqtt.MQTT_ERR_CONN_LOST, - mqtt.MQTT_ERR_CONN_REFUSED, mqtt.MQTT_ERR_NOMEM, mqtt.MQTT_ERR_ERRNO, + mqtt.MQTT_ERR_CONN_REFUSED, mqtt.MQTT_ERR_ERRNO, mqtt.MQTT_ERR_NO_CONN, mqtt.MQTT_ERR_PAYLOAD_SIZE, mqtt.MQTT_ERR_QUEUE_SIZE, mqtt.MQTT_ERR_UNKNOWN}: self.logger.warning('Unexpected disconnection from {}:{}. MQTT error: {}'.format(