[master] Stream MAVLink log removal and stop asking lsof file by file - #4130
Draft
joaoantoniocardoso wants to merge 4 commits into
Draft
[master] Stream MAVLink log removal and stop asking lsof file by file#4130joaoantoniocardoso wants to merge 4 commits into
joaoantoniocardoso wants to merge 4 commits into
Conversation
… 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
force-pushed
the
fix/mavlink-log-remove-stream
branch
from
August 11, 2026 22:16
48e0023 to
b695010
Compare
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.
Brings #4123 into master
Fixes #4105 for master