Skip to content

[ignore me] Simulated next 1.4-dev - #4131

Draft
joaoantoniocardoso wants to merge 18 commits into
bluerobotics:1.4-devfrom
joaoantoniocardoso:1.4-dev-next
Draft

[ignore me] Simulated next 1.4-dev#4131
joaoantoniocardoso wants to merge 18 commits into
bluerobotics:1.4-devfrom
joaoantoniocardoso:1.4-dev-next

Conversation

@joaoantoniocardoso joaoantoniocardoso changed the title frontend: store: Use linux2rest network probe deltas for rates [ignore me] Simulated next 1.4-dev Aug 11, 2026
joaoantoniocardoso and others added 15 commits August 11, 2026 20:11
When no board can be started, auto_restart_ardupilot() retried every 5s
forever. Each cycle leaks file descriptors, so after ~30 minutes the
service hit EMFILE and uvicorn's accept loop began logging a traceback
per retry, pegging the CPU and making the API unresponsive. That also
removed the only recovery path, since selecting SITL requires a working
/available_boards.

Give up after 10 consecutive failures instead. Transient failures still
self-heal, and an explicit start or board change re-arms the watchdog.

The counter lives in __init__ rather than setup(), because setup() runs
on every start attempt and would reset it.

Fixes bluerobotics#4070
nmea_injector is the only service whose main.py imports its own package
by name, and it lived inside that package. Running it directly puts the
package directory itself on sys.path, so `import nmea_injector` cannot
resolve and the service crash-loops on startup.

This used to work because install-services.sh ran `pip3 install .` for
every service, installing them as packages. The uv migration set
`package = false` everywhere, which stopped that, and nmea_injector was
the only service that depended on it.

Moving main.py up to the service root puts the parent directory on
sys.path instead, matching every other service and the layout master
already uses.

Rename cherry-picked from b95daa2,
dropping its unrelated shebang and wifi changes.
Different log formats make navigating and interpreting them confusing,
and local-time stamps are ambiguous across vehicles in different
timezones.

Unlike master, 1.4 registers a file sink in init_logger, so the format
is applied there as well. Without it the log files users download would
keep the old format and only stderr would be fixed.

Backport of c1e2190.
Log contents are now ISO 8601 UTC, but the filenames were still local
time, so a log dump disagreed with itself about the timezone.

The extended format is not filename friendly, so the basic format is
used instead. Lexicographic order still matches chronological order.
… 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.
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.
…stream

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.
From Willian's intermediate commit 0f366e2 (dropped when pykson
save lock was removed for master).
…nd save

Clear temp files under the same lock as save() so load() cannot
delete a .tmp file while save() is replacing it.
…nect

After a Pixhawk reboot the USB device re-enumerates with a new path while
the MAVLink router keeps a stale serial handle. Wait for the board to drop
and return, then reopen the link on the freshly detected path. On failure,
stop the router and clear should_be_running so the stale handle is not left
running with its watchdog disarmed.
Serial board restarts wait for USB re-enumeration before reopening the
MAVLink link, which can take tens of seconds.
Map tray upload/download speeds from received_B/transmitted_B divided by
the linux2rest Sampler interval instead of re-differencing total_* across
frontend polls. Show the same probe deltas on NetworkCard.
nicoschmdt and others added 3 commits August 11, 2026 21:21
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
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.

4 participants