Skip to content

Fix offline machine semaphore notification - #5330

Open
DrewScoggins wants to merge 1 commit into
mainfrom
fix/helix-offline-semaphore
Open

DrewScoggins wants to merge 1 commit into
mainfrom
fix/helix-offline-semaphore

Conversation

@DrewScoggins

Copy link
Copy Markdown
Member

Summary

  • isolate the machine-health fallback virtual environment from Helix PYTHONPATH/PYTHONHOME
  • preserve Linux prerequisite failures after the best-effort machine health check
  • add regression tests for both failure modes

Background

During the August Viper pool incident, 10 machines detected an interrupted dpkg state and successfully created /etc/helix-prep/offline, but all 10 failed to write their offline-machines semaphore. The fallback virtual environment inherited Helix's PYTHONPATH, causing /etc/helix/scripts/azure to shadow the Azure SDK packages installed into the venv. The resulting import failed with No module named 'azure.storage.queue'.

The Linux prerequisite command sequence also returned success after running the health check, masking the original setup failure.

Validation

  • py -3 -m pytest scripts/tests/test_machine_health.py scripts/tests/test_run_performance_job.py -q
  • 7 tests passed
  • verified the generated POSIX health-check path exits with code 1 after the best-effort notification

Isolate the fallback Azure SDK environment from Helix PYTHONPATH and preserve Linux prerequisite failures after machine health checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a871b3ed-f5bd-4e33-8e77-69156ad981fb
Copilot AI balanced review requested due to automatic review settings October 1, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused fixes correctly address both reported failure modes with regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes offline-machine notification reliability when Linux prerequisite setup fails.

Changes:

  • Isolates the fallback virtual environment from Helix Python variables.
  • Preserves prerequisite failure status after health checks.
  • Adds regression coverage for both failures.
File Description
scripts/​machine_health.py Sanitizes the fallback venv environment.
scripts/​run_performance_job.py Restores failure exit status after health checks.
scripts/​tests/​test_machine_health.py Tests Python environment isolation.
scripts/​tests/​test_run_performance_job.py Tests prerequisite failure preservation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants