Skip to content

Prune orphaned-state DACL ACEs whose target no longer exists#517

Open
MGudgin wants to merge 1 commit into
mainfrom
user/gudge/dacl-prune-orphaned-aces
Open

Prune orphaned-state DACL ACEs whose target no longer exists#517
MGudgin wants to merge 1 commit into
mainfrom
user/gudge/dacl-prune-orphaned-aces

Conversation

@MGudgin

@MGudgin MGudgin commented Jun 11, 2026

Copy link
Copy Markdown
Member

This PR fixes a perpetual DACL-recovery error: recover_orphaned_state() retained any ACE whose restore failed, including ACEs whose target path was already gone, so every startup re-attempted the restore and failed with PATH_NOT_FOUND forever.

Details

  • Prune an ACE when its target is confirmed missing (try_exists() == Ok(false)); an ambiguous Err (e.g. access denied) is still retried, with a re-check after a failed restore to cover the delete-during-recovery race.
  • Add RecoveryReport.aces_pruned_missing and surface the count in the recovery diagnostic line.

Tests

  • New unit test: a dead-pid orphan whose ACE targets a missing path is pruned rather than errored, and the fully-pruned state file is removed.
  • cargo check -p wxc passed.

Copilot AI review requested due to automatic review settings June 11, 2026 16:22
@MGudgin MGudgin requested a review from a team as a code owner June 11, 2026 16:22

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.

Pull request overview

This PR addresses repeated startup failures in Windows DACL recovery by pruning orphaned DACL-state ACE entries when the target path is confirmed missing, preventing perpetual PATH_NOT_FOUND retries. It also adds reporting so the recovery diagnostic distinguishes “restored” vs “pruned (missing)” ACEs, and includes a unit test for the missing-target pruning behavior.

Changes:

  • Prune orphaned-state ACE entries when try_exists() == Ok(false), including a re-check after a failed restore attempt to handle delete-during-recovery races.
  • Extend RecoveryReport with aces_pruned_missing and surface it in the wxc startup recovery log line.
  • Add a unit test ensuring missing-target ACEs are pruned (not treated as errors) and fully-pruned state files are removed.
Show a summary per file
File Description
src/core/wxc/src/main.rs Updates the startup “DACL recovery” diagnostic to include the count of pruned missing-target ACEs.
src/core/wxc_common/src/filesystem_dacl.rs Implements pruning logic for missing targets, adds reporting via RecoveryReport, and adds a unit test covering the new behavior.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

This PR fixes a perpetual DACL-recovery error: recover_orphaned_state() retained
any ACE whose restore failed, including ACEs whose target path was already gone,
so every startup re-attempted the restore and failed with PATH_NOT_FOUND
forever.

Details

* Prune an ACE when its target is confirmed missing (try_exists() == Ok(false));
  an ambiguous Err (e.g. access denied) is still retried, with a re-check after a
  failed restore to cover the delete-during-recovery race.
* Add RecoveryReport.aces_pruned_missing and surface the count in the recovery
  diagnostic line.

Tests

* New unit test: a dead-pid orphan whose ACE targets a missing path is pruned
  rather than errored, and the fully-pruned state file is removed.
* cargo check -p wxc passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MGudgin MGudgin force-pushed the user/gudge/dacl-prune-orphaned-aces branch from 24be88c to c06110d Compare June 11, 2026 16:26
@MGudgin

MGudgin commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

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