Issue339 try5 fail connections in main loop #1295
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a third pass at not looping to retry broker connections in the amqp and mqtt moth drivers. They now attempt to connect once, and have an exponential backoff implementation to that they don't try to connect again too soon.
This is a preparatory change to, in future, being able to work with multiple broker connections, where if one fails the other still works. Without this change, when a failure in one broker happens, it will just loop trying to re-connect to it, and not even look at the available good connection to the other broker.
previous attempts : #1247
The first two patches here are different, in that it was split into two, so that, in the first patch, you see the substantive changes made to getSetup and putSetup (removing the loop, making it return instead.) the second patch, just fixes the indenting and gets rid of the now dead code (mqtt/putSetup was missed on first pass, so both changes combined in second patch for that routine.)
The remainder of the patches implement ebo (exponential back off) of broker connections.
Ran the flow tests... seems fine.