NLnetLabs / rotonda

Modular, programmable BGP Engine
https://nlnetlabs.nl/projects/routing/rotonda/
Mozilla Public License 2.0
37 stars 1 forks source link

Improve error when non-unique MQTT client ID causes broker disconnection #49

Open ximon18 opened 11 months ago

ximon18 commented 11 months ago

Currently this results in the following unhelpful log message: (line wrapped for readability)

[2023-11-20 23:28:10] WARN  rotonda::targets::mqtt::status_reporter: mqtt: MQTT connection error: 
Mqtt state: Io error: Custom { kind: ConnectionAborted, error: "connection closed by peer" }
ximon18 commented 10 months ago

At least in the case of broker.emqx.io it seems there's nothing we can do about this as the underlying rumqttc client code doesn't receive anything either, it just discovers that its connection has been closed hence the error message it produces. Also, when reconnecting we cause another connected client to disconnect, the rumqttc client code doesn't receive an error about duplicate client ID.

ximon18 commented 10 months ago

The same behaviour was also observed with broker.hivemq.com, test.mosquitto.or, publicmqtt.bevywise.com and a locally running EMQX Docker MQTT broker.

ximon18 commented 10 months ago

I wonder if this is an MQTTv3 protocol thing and with v5 it would be different?