Skip to content

enhancement(mesh): remove late packets from tx queue when full#9779

Merged
thebentern merged 3 commits intomeshtastic:developfrom
m1nl:enhance_tx_queue_management
Feb 28, 2026
Merged

enhancement(mesh): remove late packets from tx queue when full#9779
thebentern merged 3 commits intomeshtastic:developfrom
m1nl:enhance_tx_queue_management

Conversation

@m1nl
Copy link
Contributor

@m1nl m1nl commented Feb 28, 2026

In busy environments, especially when operating in the ROUTER_LATE role, the TX queue fills up very quickly. As a result, delayed packets become stale, while newly received packets that require retransmission cannot be added to the TX queue because older packets remain there for an extended period (sometimes a minute or more).

This change modifies the queue handling logic to prioritize new packets over stale ones. If the TX queue is full, a late packet from the back of the queue will be removed to make room for a new packet. This ensures that fresh transmissions are not blocked by outdated packets and improves overall network responsiveness in busy environments - especially when node holds ROUTER_LATE role.

A more aggressive approach would be to remove a packet even if it is not yet late, but has a higher TX delay than the packet being enqueued. I successfully tested this behavior on my own node. However, the currently proposed implementation appears to be a reasonable compromise between improving responsiveness and avoiding overly aggressive packet drops.

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

In busy environments, especially for ROUTER_LATE role, tx queue
fills very quickly. Delayed packets became late but new packets
to be retransmitted won't be put into the tx queue as old ones
stay there for a very long time (even a minute or more). This change
makes meshtastic prioritize new packets over late packets from tx queue
and allows to remove late packet from back of tx queue when there
is no space for a new one.
@github-actions github-actions bot added the enhancement New feature or request label Feb 28, 2026
@thebentern thebentern requested review from GUVWAF and Copilot February 28, 2026 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves TX queue behavior under heavy mesh load (notably for ROUTER_LATE) by evicting stale delayed packets so newly received packets can be queued and retransmitted promptly.

Changes:

  • Update TX queue eviction logic to drop a late packet from the back of the queue when full and enqueuing a newer packet.

Copy link
Member

@GUVWAF GUVWAF left a comment

Choose a reason for hiding this comment

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

Sounds like a good optimization to me.

@thebentern thebentern merged commit 563adc6 into meshtastic:develop Feb 28, 2026
26 of 67 checks passed
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.

4 participants