Skip to content

fix: bound queued incoming QoS 0 publishes - #96

Closed
hugues bouvier (huguesBouvier) wants to merge 1 commit into
mainfrom
hugues/bound-incoming-qos0-queue
Closed

fix: bound queued incoming QoS 0 publishes#96
hugues bouvier (huguesBouvier) wants to merge 1 commit into
mainfrom
hugues/bound-incoming-qos0-queue

Conversation

@huguesBouvier

Copy link
Copy Markdown

Summary

  • cap queued incoming QoS 0 PUBLISH packets with a configurable permit budget
  • drop excess QoS 0 packets without blocking the connection event loop
  • leave QoS 1/2 delivery and acknowledgement handling unchanged

Context

The incoming application-message channel is unbounded. QoS 1/2 traffic is constrained by MQTT Receive Maximum and packet identifiers, but QoS 0 has no protocol-level flow control. If an application stops draining Receiver, QoS 0 publishes can accumulate until the process runs out of memory.

This was observed while investigating Azure-NBC PR 16518887. The permit is carried with each queued QoS 0 publish and released when the receiver drains or drops it, preserving message order without blocking socket progress.

Validation

  • make check
  • make test
  • added coverage for overflow drops, capacity recovery, and QoS 1 non-regression

Cap queued QoS 0 publishes with permits while leaving QoS 1 and 2
under MQTT protocol flow control. Excess QoS 0 messages are dropped
without blocking connection progress.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@huguesBouvier

Copy link
Copy Markdown
Author

Vendored SDK mirror is open at Azure/iot-operations-sdks#1437. This source PR is fully green; the mirror PR local Rust checks pass, while its secret-dependent integration jobs require a maintainer-owned branch because it originates from a fork.

@cartertinney Carter Tinney (cartertinney) added the enhancement New feature or request label Jul 27, 2026
@cartertinney

Copy link
Copy Markdown
Collaborator

As discussed offline, we can take this on the vendored version for now, and spend some time considering how to best fix this for the full version here.

@cartertinney

Copy link
Copy Markdown
Collaborator

Moved to track in #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants