Skip to content

core: kraken: Fix extension uptime after clock sync - #4095

Draft
Daniiiil1 wants to merge 1 commit into
bluerobotics:masterfrom
Daniiiil1:codex/fix-extension-uptime
Draft

core: kraken: Fix extension uptime after clock sync#4095
Daniiiil1 wants to merge 1 commit into
bluerobotics:masterfrom
Daniiiil1:codex/fix-extension-uptime

Conversation

@Daniiiil1

Copy link
Copy Markdown

Closes #3416

What changed

  • derive running-container uptime from the host process's monotonic start time instead of Docker's wall-clock duration
  • preserve Docker status suffixes such as (healthy) and (Paused)
  • fall back to Docker's original status if the process disappears during inspection
  • cover duration formatting, clock-skew correction, and fallback behavior with regression tests

Root cause

Docker builds the human-readable Status field by subtracting StartedAt from the current wall clock. BlueOS can start extensions before the Raspberry Pi synchronizes its clock, so a later NTP correction makes long-running extensions appear older than the host.

BlueOS Core runs in the host PID namespace. Kraken can therefore derive each container process's start offset from boot and compare it with time.monotonic(), which is unaffected by wall-clock corrections.

User impact

Extension cards now report the actual process uptime after system clock synchronization while keeping the existing status text and health information.

Validation

  • pytest -q core/services/kraken/harbor/test_container.py (10 passed)
  • existing core/services/kraken/test_kraken.py tests (2 passed)
  • Black, isort, Ruff, mypy, and pylint (10.00/10) on the changed files

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.

extension-manager: wrong extensions uptime

1 participant