Repository navigation
fix(mesh): don't evict ACKs when a background-priority packet arrives full - #10435
DatanoiseTV wants to merge 1 commit into
Conversation
fromRadioQueue is a plain FIFO of size 4. When it fills, the prior behaviour was to drop the oldest packet — usually a routing ACK or reply — to make room for whatever just arrived, even if the new packet was BACKGROUND priority. Reverse that for the low-priority case: if the incoming packet's priority is at or below BACKGROUND, drop it instead. Higher-priority arrivals still evict to fit. PointerQueue doesn't expose iteration, so a full priority-queue refactor would be a larger change; this addresses the worst case.
There was a problem hiding this comment.
Pull request overview
This PR improves receive-side routing reliability by changing Router::enqueueReceivedMessage() to avoid evicting already-queued packets (often ACKs/routing replies) when fromRadioQueue is full and the newly arrived packet is low priority (≤ BACKGROUND). This targets a worst-case behavior where a burst of low-priority traffic could displace higher-value control-plane packets.
Changes:
- Drop incoming packets with priority ≤
BACKGROUNDwhenfromRadioQueueis full, instead of evicting the oldest queued packet. - Preserve the prior “evict oldest until it fits” behavior for higher-priority incoming packets.
| if (!fromRadioQueue.enqueue(p, 0)) { | ||
| if (p->priority != meshtastic_MeshPacket_Priority_UNSET && p->priority <= meshtastic_MeshPacket_Priority_BACKGROUND) { | ||
| printPacket("fromRadioQ full, drop incoming low-prio!", p); | ||
| packetPool.release(p); |
|
Are you observing that the FIFO ever gets full? |
|
If this really is an issue, this can be reopened. At present, I concur with Guvwaf - if the queue is full, make it bigger. |
fromRadioQueue is a plain FIFO of size 4. When it fills, the prior
behaviour was to drop the oldest packet — usually a routing ACK or
reply — to make room for whatever just arrived, even if the new packet
was BACKGROUND priority. Reverse that for the low-priority case: if
the incoming packet's priority is at or below BACKGROUND, drop it
instead. Higher-priority arrivals still evict to fit. PointerQueue
doesn't expose iteration, so a full priority-queue refactor would be a
larger change; this addresses the worst case.
Split out from #10424 per @thebentern's request — single-concern PR.
Build verification
pio run -e t-deck-tftsucceeds, no new warnings.Attestations
t-deck-tftonly.