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

Add mqtt reconnect counter #2319

Merged
merged 22 commits into from
Jun 24, 2022
Merged

Add mqtt reconnect counter #2319

merged 22 commits into from
Jun 24, 2022

Conversation

vaavva
Copy link
Member

@vaavva vaavva commented Jun 15, 2022

Checklist

  • I have read the [contribution guidelines] (https://github.com/Azure/azure-iot-sdk-c/blob/main/.github/CONTRIBUTING.md).
  • I added or modified the existing tests to cover the change (we do not allow our test coverage to go down).
  • If this is a modification that impacts the behavior of a public API
    • I edited the corresponding document in the devdoc folder and added or modified requirements.
  • I submitted this PR against the correct branch:
    • This pull-request is submitted against the main branch.
    • I have merged the latest main branch prior to submission and re-merged as needed after I took any feedback.
    • I have squashed my changes into one with a clear description of the change.

Reference/Link to the issue solved with this PR (if any)

Description of the problem

When we added a retry of messaged after reconnection to ensure mqtt messages are sent in order, this caused us to use up the retries very quickly. This PR adds a separate counter for retrying messages in the case of a reconnect so that if there are a few disconnect/reconnects in a row it doesn't automatically expire the message.

Description of the solution

…sages if last reconnect was too recent (i.e. device is rapidly disconnecting and reconnecting)
@vaavva vaavva marked this pull request as draft June 15, 2022 22:09
@ericwolz
Copy link
Contributor

ericwolz commented Jun 16, 2022

Ok, this is a better solution. Thanks!

* Added mqtt disconnect trace logs

* Update iothub_client/src/iothubtransport_mqtt_common.c

Co-authored-by: Dane Walton <[email protected]>

Co-authored-by: Dane Walton <[email protected]>
@ericwolz
Copy link
Contributor

ericwolz commented Jun 17, 2022 via email

Copy link
Contributor

@ewertons ewertons left a comment

Choose a reason for hiding this comment

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

Unit tests must be updated to reflect the changes as well.

@vaavva vaavva marked this pull request as ready for review June 23, 2022 22:40
@vaavva vaavva enabled auto-merge (squash) June 24, 2022 18:35
@vaavva vaavva merged commit d94368d into main Jun 24, 2022
@vaavva vaavva deleted the vaavva/add-mqtt-reconnect-timer branch June 24, 2022 21:31
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.

4 participants