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

Handled client's receive maximum property to avoid publish flooding #858

Merged
merged 6 commits into from
Oct 26, 2024

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Sep 28, 2024

Release notes

Handled client's receive maximum property to configure the inflight window through the client

What does this PR do?

The main change contained in this PR is usage of a sendQuota in the MQTTConnection to keep the inflight zone size instead of Session's inflightSlots. The method used to resend inflight messages has been updated to respect the send quota (aka receive_maximum property ) expressed by the client on CONNECT message.
If the inflight space is bigger than the actual send quota, maybe because the client squeezed it on a reconnection, it partition the inflight to fill up the send quota. The resend of inflight take precedence over queue drain both on processing of QoS1 PUBACK and QoS2 PURBEC.
If client connects through MQTT 3 the hardcoded limit (10) is used for inflight zone.
If it connects with MQTT5 it reads the receive_maximum property or set to default 65535 default value if not specified.

Why is it important/What is the impact to the user?

Respect the receive_maximum asked from the client on MQTT5 connection.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the Changelog if it's a feature or a fix that has to be reported

Related issues

@andsel andsel self-assigned this Sep 28, 2024
@andsel andsel mentioned this pull request Sep 28, 2024
4 tasks
@andsel andsel force-pushed the feature/flow_control_through_client branch from d961d43 to 2329561 Compare October 26, 2024 15:29
@andsel andsel force-pushed the feature/flow_control_through_client branch from 24d815b to a1f73cd Compare October 26, 2024 15:32
@andsel andsel marked this pull request as ready for review October 26, 2024 15:59
@andsel andsel merged commit 0d22c0d into moquette-io:main Oct 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow control
1 participant