thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
219 stars 54 forks source link

fix: apply delay to mqtt connect errors by default #2832

Closed Bravo555 closed 5 months ago

Bravo555 commented 5 months ago

Proposed changes

Instead of retrying MQTT connection immediately for some errors, apply delay before retrying connection by default for all errors.

One could argue that for errors where we know we're going to receive it again, e.g. misconfiguring certificates, we should exit instead of retrying, but because rumqttc doesn't organize its errors very well, it would be hard to ensure that every variant is covered, whereas this is simple and works.

Types of changes

Paste Link to the issue

Checklist

Further comments

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 76.6%. Comparing base (e7bf843) to head (c0b0f6a). Report is 1 commits behind head on main.

Additional details and impacted files | [Files](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2832?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge) | Coverage Δ | | |---|---|---| | [crates/common/mqtt\_channel/src/connection.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2832?src=pr&el=tree&filepath=crates%2Fcommon%2Fmqtt_channel%2Fsrc%2Fconnection.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2NvbW1vbi9tcXR0X2NoYW5uZWwvc3JjL2Nvbm5lY3Rpb24ucnM=) | `60.0% <0.0%> (+4.4%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2832/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge)
github-actions[bot] commented 5 months ago

Robot Results

:white_check_mark: Passed :x: Failed :next_track_button: Skipped Total Pass % :stopwatch: Duration
429 0 3 429 100 0s