Skip to content

updater(fixes): Self-heal hardening and previous commit fix#283

Merged
HugoCLSC merged 3 commits into
devfrom
bugfix/updater-selfheal-hardening
Jul 15, 2026
Merged

updater(fixes): Self-heal hardening and previous commit fix#283
HugoCLSC merged 3 commits into
devfrom
bugfix/updater-selfheal-hardening

Conversation

@gmmcosta15

Copy link
Copy Markdown
Collaborator

Description

Select the type:

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

Hardens updater self-heal recovery against real git/filesystem faults surfaced by a real-git chaos test.

Changes:

  • Clear a STALE .git/index.lock (age-guarded, >10s) before the recovery reset in git_reset_to_hash/git_repair, so a SIGKILL'd/interrupted git op no longer permanently blocks runtime self-heal (start.sh only cleared it at boot). Fresh locks (<10s) are preserved so a concurrent legitimate git op is never corrupted.
  • Recover a corrupt/unreadable .git/HEAD: git_repair re-verifies HEAD after repair (_is_head_readable) and rewrites it via symbolic-ref (_repair_corrupt_head) instead of trusting fetch success; _reconcile_locked only treats a repair as done when HEAD is actually readable.
  • Detect more corruption wordings in git_has_corruption: "unable to unpack", "inflate: data stream error".

Motivation

Devices must self-recover from power-cut/SIGKILL git corruption without a physical reflash. A real-git chaos test found these runtime recovery gaps; this closes them.

@gmmcosta15 gmmcosta15 self-assigned this Jul 15, 2026
@gmmcosta15 gmmcosta15 requested a review from HugoCLSC July 15, 2026 14:37
@HugoCLSC HugoCLSC merged commit d22fb72 into dev Jul 15, 2026
6 of 7 checks passed
@HugoCLSC HugoCLSC deleted the bugfix/updater-selfheal-hardening branch July 15, 2026 15:26
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.

2 participants