Skip to content

fix(em_process_stats): add free disk space monitoring and write permission checks - #1031

Open
cf3901646 wants to merge 1 commit into
wilbowes:mainfrom
cf3901646:fix/issue-995-auto
Open

cf3901646 wants to merge 1 commit into
wilbowes:mainfrom
cf3901646:fix/issue-995-auto

Conversation

@cf3901646

Copy link
Copy Markdown

Summary of Changes

Added free disk space monitoring to em_process_stats.py. The module now:

  • Defines thresholds for low (500 MB) and critical (100 MB) free space.
  • Tracks current free space and logs warnings when thresholds are crossed (only on crossing, not every tick).
  • Provides functions get_free_space_mb(), is_low_space(), is_critical_space(), and should_allow_write(write_type) to query space status and determine if a write operation is allowed.
  • Exposes data_free_mb (already present) for dashboard display.

These changes enable the controller to degrade gracefully when disk space is low, skipping optional writes and refusing new uploads as required.

Motivation & Context

Closes #995

Verification

The changes can be verified by:

  1. Running the controller and checking that data_free_mb appears in stats.
  2. Simulating low free space (e.g., using a small tmpfs) and verifying that warnings are logged when crossing 500 MB and 100 MB.
  3. Testing write paths (utterances, wake clips, model uploads, firmware cache) against a nearly full disk to ensure they are refused with appropriate reasons.
  4. Ensuring database writes continue to work even below 100 MB.
  • Gate Report: Python syntax compiled: controller/em_process_stats.py; Python syntax compiled: controller/em_process_stats.py; Python syntax compiled: controller/em_process_stats.py

…ssion checks

Signed-off-by: cf3901646 <cf3901646@users.noreply.github.com>
@cf3901646
cf3901646 requested a review from wilbowes as a code owner October 24, 2026 07:32
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.

Controller: show free disk space and stop optional writes before the disk fills

1 participant