Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client stops attempting to reconnect once 60second timeout reached #25

Closed
knolleary opened this issue Jun 13, 2016 · 0 comments
Closed

Comments

@knolleary
Copy link
Contributor

If a connected client looses it's connection it starts a reconnect timer. After a few attempts the reconnect time is increased to 10 seconds and then to 60 seconds. Once it reaches 60 seconds it never successfully connects regardless of the availability of the iot service.

In node-red this results in having to restart node-red to get the node reconnected following an outage of the iot service, as happened this weekend.

The problem is ultimately a bug in the underlying mqtt library which I've raised here - mqttjs/MQTT.js#419

The workaround to the issue is to ensure the connectTimeout option passed to the MQTT client is always greater than the reconnectTimeout.

I've tested a fix locally to this client by adding the following line here: https://github.com/ibm-watson-iot/iot-nodejs/blob/master/src/clients/BaseClient.js#L77

this.mqttConfig.connectTimeout = 90*1000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant