Skip to content

fix(libvirt): harden failure observability - #1191

Open
Brad-Edwards wants to merge 3 commits into
devfrom
1173-safe-failure-observability
Open

fix(libvirt): harden failure observability#1191
Brad-Edwards wants to merge 3 commits into
devfrom
1173-safe-failure-observability

Conversation

@Brad-Edwards

@Brad-Edwards Brad-Edwards commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Plain-Language Summary

  • Context: Libvirt lifecycle adapters intentionally collapse a small set of expected backend conditions into portable outcomes.
  • Problem: Ambiguous native-error matching and unsafe telemetry extraction could turn real failures into successful no-ops or let logging alter control flow.
  • Fix: Classify only genuine native errors with operation-specific codes and emit bounded, non-interfering failure metadata.

Summary

Harden libvirt failure telemetry and native error classification so hostile exception and logging behavior cannot alter backend control flow, while preserving retry state for non-absence failures.

Requirement UIDs

  • RUN-316

Related Issues

Closes #1173

ADR Impact

  • ADR-015
  • ADR-036
  • ADR-066

Changes

  • Bound and sanitize suppressed-failure metadata while making logger and exception inspection non-interfering.
  • Centralize operation-specific native libvirt error classification and apply it across deployment and TechVault lifecycle paths.
  • Add adversarial regression coverage for native identity, mismatched resource codes, fail-closed deployment, retry state, and stress-test timing.

Test Plan

  • Unit tests pass
  • Integration tests pass if applicable
  • Configured completion command passes
  • No coverage regression

Focused libvirt suite: 364 passed, 2 deselected. Full Python unit suite: 7,235 passed, 3 skipped, 4 xfailed. Ground Control completion, policy, and pre-commit gates passed.

Verification

  • pytest implementations/python/tests/test_libvirt_failure_observability.py implementations/python/tests/test_libvirt_backend_driver.py: 364 passed, 2 deselected.
  • Full Python unit suite: 7,235 passed, 3 skipped, 4 xfailed.
  • Ground Control completion, repository policy, pre-commit, and canonical CI verification passed.

Ground Control Checks

  • Configured repository policy command passes
  • Pre-push code review and test-quality review completed; all findings fixed or dispositioned

Traceability

  • IMPLEMENTS: RUN-316 ← implementations/python/packages/raes_backend_libvirt/_observability.py, RUN-316 ← implementations/python/packages/raes_backend_libvirt/drivers/libvirt/_native.py, RUN-316 ← implementations/python/packages/raes_backend_libvirt/drivers/libvirt/deployment.py, RUN-316 ← implementations/python/packages/raes_backend_libvirt/techvault_lifecycle.py
  • TESTS: RUN-316 ← implementations/python/tests/test_libvirt_failure_observability.py, RUN-316 ← implementations/python/tests/test_libvirt_backend_driver.py, RUN-316 ← implementations/python/tests/test_participant_concurrent_batch_reservations.py

Issue Tracking

Closes #1173

Checklist

  • Code follows the project's coding standards
  • Changelog: owned by Release Please (generated from the Conventional Commit PR title; no per-PR fragment)
  • Architectural docs updated if stack, package structure, or key behaviors changed

Documentation

Updated: see diff.

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.

1 participant