docs(network): report MAVLink UDP read path stall under sustained ingest - #2151
docs(network): report MAVLink UDP read path stall under sustained ingest#2151krital wants to merge 2 commits into
Conversation
Documents a suspected bug where the server stops draining its MAVLink UDP socket after 20-40 minutes of sustained ~360 msg/s ingest. Includes thread dump and ss evidence, the hypotheses already ruled out, a reproduction, and the supervisor workaround currently in use. NO-ISSUE
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ingest 19 faults, mean 82 min / median 56 min between them, Recv-Q 163-214 KB at detection. Reproduces with no external clients connected, so subscriber activity is not the trigger. NO-ISSUE
Update: 24.6 h of continuous observation — this is frequentThe environment has now run unattended for a full day, with the supervisor
Intervals in minutes, in order: What the spread rules outThe interval doesn't correlate with anything I can see:
The clustering of Recv-Q at detection (163–214 KB) is just an artefact of the Why this matters beyond the demoWithout the supervisor this deployment would have been unusable for ~23 of the Happy to run a targeted experiment if it helps narrow it — the obvious one being |
What this is
A bug report, not a fix — filing it as a PR so the investigation lands in the
repo next to the code. Happy for it to be converted to an issue instead if that
suits triage better.
The problem
After 20–40 minutes of sustained MAVLink ingest (~360 msg/s over UDP), the server
stops reading its MAVLink UDP socket. Datagrams pile up unread in the kernel
receive queue while the broker stays otherwise healthy — REST, MQTT and the web
UIs keep serving normally. It never recovers on its own; restarting the sender
does nothing, only restarting the broker clears it.
Operationally this shows up as "all vehicles vanish from the map while the server
looks fine", because MAVLink stops flowing and the twins then pass
retentionTimeoutMillis.Evidence (captured while stalled)
ss -u -ashows Recv-Q pinned at 170–211 KB across three consecutivesamples a minute apart (healthy value is
0)kill -3shows every SelectorThread idle inEPoll.wait— nothing blockedon a lock, the store, or I/O; no deadlock
Already ruled out
Partition)type: memoryRemaining suspicion is that the UDP endpoint's selector registration is lost or
cancelled without the endpoint being torn down — socket stays open and buffered
but is never selected for read again.
One possibly-relevant detail:
selectorThreadCount: "{processors}/2"resolves to1 on the 2-vCPU host this was seen on. Whether a larger explicit selector pool
avoids it is untested.
Workaround currently running
A supervisor samples Recv-Q every 60s and restarts the broker after three
consecutive readings >100 KB. Confirmed working — ~30s outage, re-armed 4s after
firing.
Two secondary observations
MavlinkProtocollogsFailed to store MAVLink message on topic '<topic>': {}; the{}is neversubstituted so the underlying exception is lost. This cost real debugging time.
(
ERROR … Destination /mavlink/3/TIMESYNC created,ERROR … anonymous successfully logged off,WARN … Created Protocol WS),so a healthy server's log reads as though it is failing.
Full detail, including the reproduction and the raw thread dump, is in
docs/review/MAVLINK-UDP-READ-STALL.md.