Commit b295d763 authored by Johan Ström's avatar Johan Ström

mqtt: Fix initial sporadic connection failures

parent 3f3ec099
Pipeline #459 passed with stage
in 2 minutes and 48 seconds
......@@ -255,9 +255,13 @@ bool agotransport::MqttImpl::start() {
break;
} else {
if(rc == MOSQ_ERR_ERRNO && errno == ENOTCONN) {
// Silently ignore, seen on FreeBSD a few times during setup,
// depending on log level (i.e. some other race condition?)
break;
// Seen on FreeBSD a few times during setup:
// depending on log level (i.e. some other race condition?) we sometime get this
// and the connection is not up.
// Retrying seems to work
AGOL_TRACE(transport) << "Connection failed: " << mosquitto_strerror(rc);
usleep(50000);
continue;
}
AGOL_ERROR(transport) << "Connection failed: " << mosquitto_strerror(rc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment