chirpstack / chirpstack-gateway-bridge

ChirpStack Gateway Bridge abstracts Packet Forwarder protocols into Protobuf or JSON over MQTT.
https://www.chirpstack.io
MIT License
415 stars 269 forks source link

fix: prevent duplicate mqtt connections #229

Closed jburhenn closed 1 year ago

jburhenn commented 1 year ago

This change is to fix issue https://github.com/chirpstack/chirpstack-gateway-bridge/issues/226.

Since the chirpstack connection timeout is shorter than the Paho one it can retry a connection while Paho is still attempting the first one. If both eventually succeed they can fight over the connection causing a constant disconnect/reconnect loop. This change increases the default chirpstack connection timeout and disconnects before it attempts a retry to prevent multiple connections from being made.