Skip to content

Fix Windows ownership batch timeout causing 3 files to retain wrong owner#70

Merged
travis-hoover-glean merged 1 commit into
mainfrom
fix/windows-ownership-batch-timeout
Apr 15, 2026
Merged

Fix Windows ownership batch timeout causing 3 files to retain wrong owner#70
travis-hoover-glean merged 1 commit into
mainfrom
fix/windows-ownership-batch-timeout

Conversation

@travis-hoover-glean
Copy link
Copy Markdown
Contributor

@travis-hoover-glean travis-hoover-glean commented Apr 15, 2026

Summary

Root cause: setOwnerWindowsBatch processes ~21 paths sequentially via PowerShell Set-Acl (2-4s each on the test machine) with a hardcoded 60s timeout. The three failing hosts are last in the registry processing order — their paths at positions 16, 19, and 20 of 21 simply never get reached before the timeout kills the process.

Fix:

  • Scale timeout dynamically: Math.max(60_000, paths.length * 15_000) — 15s per path budget with 60s floor
  • Add -ErrorAction Stop to Get-Acl and Set-Acl so non-terminating PowerShell errors are properly caught by try/catch
  • Add per-path progress logging (Write-Output "[$i/$total] OK: $p") for diagnosability

…wner

The setOwnerWindowsBatch PowerShell command had a hardcoded 60s timeout
processing ~21 paths sequentially via Set-Acl (~2-4s each). On slower
machines the process was killed before reaching the last several paths,
leaving windsurf, gemini, and opencode configs owned by
BUILTIN\Administrators.

- Scale timeout dynamically (15s per path, 60s minimum)
- Add -ErrorAction Stop to Get-Acl/Set-Acl to catch non-terminating errors
- Add per-path progress logging for diagnosability

Fixes: PROD-23734
@travis-hoover-glean travis-hoover-glean requested a review from a team as a code owner April 15, 2026 19:50
@travis-hoover-glean travis-hoover-glean merged commit 6da8011 into main Apr 15, 2026
16 checks passed
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