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

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

Merged

Conversation

Bravo555
Copy link
Contributor

@Bravo555 Bravo555 commented Apr 22, 2024

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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codecov bot commented Apr 22, 2024

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 Coverage Δ
crates/common/mqtt_channel/src/connection.rs 60.0% <0.0%> (+4.4%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link
Contributor

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
429 0 3 429 100 0s

@Bravo555 Bravo555 added this pull request to the merge queue Apr 23, 2024
Merged via the queue into thin-edge:main with commit ac6323a Apr 23, 2024
32 checks passed
@Bravo555 Bravo555 deleted the fix/2728/mqtt-connection-error-delay branch April 23, 2024 12:44
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

Successfully merging this pull request may close these issues.

3 participants