Skip to content

[master] Stream MAVLink log removal and stop asking lsof file by file - #4130

Draft
joaoantoniocardoso wants to merge 4 commits into
bluerobotics:masterfrom
joaoantoniocardoso:fix/mavlink-log-remove-stream
Draft

[master] Stream MAVLink log removal and stop asking lsof file by file#4130
joaoantoniocardoso wants to merge 4 commits into
bluerobotics:masterfrom
joaoantoniocardoso:fix/mavlink-log-remove-stream

Conversation

@joaoantoniocardoso

Copy link
Copy Markdown
Member

Brings #4123 into master
Fixes #4105 for master

  • tested

… pass

Deletion asked lsof whether each file was open, and every lsof call rescans
every process in the system, so removing a folder cost a process spawn per
file: on a Raspberry Pi 4, 300 MAVLink logs took 42s against 0.2s for a single
recursive call. Take one snapshot per deletion and reuse it while recursing,
falling back to per-file checks when lsof fails.

Searching a folder makes lsof exit with 1 whether or not it found open files,
so failure is detected from stderr, with -w silencing the warnings about file
systems it cannot stat. lsof cannot search a single file, so folders only:
log_zipper deletes file by file and would otherwise log an error each time.
The next commit needs the same streaming response for MAVLink logs.
Removing MAVLink logs only answered once the whole folder was gone, which the
frontend gave up on. Stream each deletion like remove_log_stream already does.
Clearing around 1GB of MAVLink logs took longer than the 20s timeout, failing
with no feedback while deletion kept going on the vehicle. Stream it into the
progress UI the service logs already use.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the fix/mavlink-log-remove-stream branch from 48e0023 to b695010 Compare August 11, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout when removing ~1GB of MAVLink Log Files

1 participant