-
Notifications
You must be signed in to change notification settings - Fork 8
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
Randomise reconnect timing #315
Conversation
I think we should also include a similar randomised delay on startup. Perhaps not as extreme as 15secs, but between 2-10 secs for eg. |
As the mqtt.connect call is synchronous and following events rely on their being a client object created, the straightforward solution to this is to add a random await before the call to There is only 1 reference to the
before line 138:
would be feasible. |
Added in commit add randomised start call delay As this affects the start up time, I have kept is small enough to be less bothersome (20ms ~ 5s) |
@Steve-Mcl looks good - but a failing lint check in the tests |
🤦♂️ Thats what I get for doing it in GH fixed in 691eae7 🤞 |
and of course, tests now timeout
fix incoming. |
closes #314
Description
To alleviate stresses on broker, a variation in the reconnect timing is introduced
The exact value may wish to be tweaked but I went with upto 2 seconds sooner and no more than 10s later than the original 15s fixed time
Related Issue(s)
#314
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label