Bridge with multiple address does not cycle through available connections
When using a bridge connection with multiple addresses, if the primary address disconnects, it will only ever attempt to reconnect using the second address. The behaviour is identical with round_robin set true or false.
Configuration:
connection bridge
address 10.0.1.1:1883 10.0.0.1:1883
round_robin true
restart_timeout 1 1
keepalive_interval 5
Condensed Logs:
<10.0.1.1:1883 Available 10.0.0.1:1883 Unavailable>
1639536782: Connecting bridge (step 1) downhole-bridge (10.0.1.1:1883)
1639536782: mosquitto version 2.0.11 running
1639536782: Connecting bridge (step 2) downhole-bridge (10.0.1.1:1883)
<10.0.1.1:1883 Disconnects 10.0.0.1:1883 Unavailable>
1639536787: Client local.X.downhole-bridge disconnected: No route to host.
1639536790: Connecting bridge (step 1)bridge (10.0.0.1:1883)
1639536791: Connecting bridge (step 2) bridge (10.0.0.1:1883)
1639536791: Error creating bridge: Network is unreachable.
1639536792: Connecting bridge (step 1) bridge(10.0.0.1:1883)
1639536793: Connecting bridge (step 2) bridge(10.0.0.1:1883)
1639536793: Error creating bridge: Network is unreachable.
...
<10.0.1.1:1883 Available again 10.0.0.1:1883 Unavailable>
...
1639536983: Connecting bridge (step 1) bridge(10.0.0.1:1883)
1639536983: Connecting bridge (step 2) bridge(10.0.0.1:1883)
1639536983: Error creating bridge: Network is unreachable.
...
I think i'm seeing bridge address problems too, with 2.0.14, but my logs are inconclusive because mosquitto does not log the IP address it is using. In my case I am trying to connect to a.example.com which has both a v6 and a v4 record, and mosquitto seems to only connect to the v6, trying that repeatedly when there is no v6 connectivity but v4 works. This may be a separate bug though.
WIth 2.0.14 and two addresses configured (v6 and v4), mosquitto tries to connect to the first one listed., v6 This fails because the cert has only the name (correct behavior IMHO). Then it tries v4 and alternates. This is with round_robin at the default of false.