AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
203 stars 72 forks source link

Long delay when connecting to mosquitto broker since v1.6.4 #170

Closed pbrenna closed 5 years ago

pbrenna commented 5 years ago

The current master (and since at least f1d9885d997) can't connect (MqttClient::start) to the mosquitto broker since 1.6.4; 1.6.3 works fine.

This might be an issue with mosquitto or with this library. For reference, this is the changelog: https://mosquitto.org/ChangeLog.txt

EDIT: both with master and with f1d9885d997, it connects after a long delay (~30s).

Mosquitto's log against rumqtt master (there is only one instance of the client):

1567492711: New client connected from ::1 as mqtt_bridge (p2, c1, k60).
1567492711: No will message specified.
1567492711: Sending CONNACK to mqtt_bridge (0, 0)
1567492740: Socket error on client mqtt_bridge, disconnecting.
1567492740: New connection from ::1 on port 1883.
1567492740: New connection from ::1 on port 1883.
1567492740: New connection from ::1 on port 1883.
1567492741: New client connected from ::1 as mqtt_bridge (p2, c1, k60).
1567492741: No will message specified.
1567492741: Sending CONNACK to mqtt_bridge (0, 0)
1567492741: Client mqtt_bridge already connected, closing old connection.
1567492741: New client connected from ::1 as mqtt_bridge (p2, c1, k60).
1567492741: No will message specified.
1567492741: Sending CONNACK to mqtt_bridge (0, 0)
1567492741: Client mqtt_bridge already connected, closing old connection.
1567492741: New client connected from ::1 as mqtt_bridge (p2, c1, k60).
1567492741: No will message specified.
1567492741: Sending CONNACK to mqtt_bridge (0, 0)
pbrenna commented 5 years ago

The mosquitto configuration that causes this behavior is:

listener 1883
protocol mqtt
max_inflight_messages 0

listener 9093
protocol websockets
max_inflight_messages 0

Without the second part about websockets, the delay is not reproducible. This should be a bug on mosquitto's part (since I try to connect to port 1883).