enhancement(mesh): remove late packets from tx queue when full#9779
Merged
thebentern merged 3 commits intomeshtastic:developfrom Feb 28, 2026
Merged
enhancement(mesh): remove late packets from tx queue when full#9779thebentern merged 3 commits intomeshtastic:developfrom
thebentern merged 3 commits intomeshtastic:developfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
GUVWAF
approved these changes
Feb 28, 2026
Member
GUVWAF
left a comment
There was a problem hiding this comment.
Sounds like a good optimization to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In busy environments, especially when operating in the
ROUTER_LATErole, 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_LATErole.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.